diff options
author | Samuel Villareal | 2010-09-11 03:16:03 +0000 |
---|---|---|
committer | Samuel Villareal | 2010-09-11 03:16:03 +0000 |
commit | 993520eecddbdddddb1a562646c755e1efd0fa29 (patch) | |
tree | 8f51c4c309f20ba86371f689b68c1fdf1008b40b /src/strife/g_game.c | |
parent | dea38802d1509f806fafb7d537a413dd520ffc9c (diff) | |
download | chocolate-doom-993520eecddbdddddb1a562646c755e1efd0fa29.tar.gz chocolate-doom-993520eecddbdddddb1a562646c755e1efd0fa29.tar.bz2 chocolate-doom-993520eecddbdddddb1a562646c755e1efd0fa29.zip |
+ P_RemoveInventoryItem and P_DropInventoryItem implemented
+ Some inventory keys supported
Subversion-branch: /branches/strife-branch
Subversion-revision: 2060
Diffstat (limited to 'src/strife/g_game.c')
-rw-r--r-- | src/strife/g_game.c | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/src/strife/g_game.c b/src/strife/g_game.c index 42c8bdd3..01326425 100644 --- a/src/strife/g_game.c +++ b/src/strife/g_game.c @@ -439,12 +439,38 @@ void G_BuildTiccmd (ticcmd_t* cmd) cmd->consistancy = consistancy[consoleplayer][maketic%BACKUPTICS]; - // villsa [STRIFE] + // villsa [STRIFE] look up key if(gamekeydown[key_lookup]) cmd->buttons2 |= BT2_LOOKUP; - if (gamekeydown[key_lookdown]) + + // villsa [STRIFE] look down key + if(gamekeydown[key_lookdown]) cmd->buttons2 |= BT2_LOOKDOWN; - if (gamekeydown[key_usehealth]) + + // villsa [STRIFE] inventory use key + if(gamekeydown[key_invuse]) + { + player_t* player = &players[consoleplayer]; + if(player->numinventory > 0) + { + cmd->buttons2 |= BT2_INVUSE; + cmd->inventory = player->inventory[player->inventorycursor].sprite; + } + } + + // villsa [STRIFE] inventory drop key + if(gamekeydown[key_invdrop]) + { + player_t* player = &players[consoleplayer]; + if(player->numinventory > 0) + { + cmd->buttons2 |= BT2_INVDROP; + cmd->inventory = player->inventory[player->inventorycursor].sprite; + } + } + + // villsa [STRIFE] use medkit + if(gamekeydown[key_usehealth]) cmd->buttons2 |= BT2_HEALTH; @@ -1210,6 +1236,13 @@ void G_PlayerReborn (int player) for (i=0 ; i<NUMAMMO ; i++) p->maxammo[i] = maxammo[i]; + + // villsa [STRIFE] TODO - verify + for(i = 0; i < 32; i++) + { + p->inventory[i].sprite = -1; + p->inventory[i].type = NUMMOBJTYPES; + } } |