diff options
Diffstat (limited to 'src/strife')
-rw-r--r-- | src/strife/p_user.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/strife/p_user.c b/src/strife/p_user.c index 4d52001c..80f33929 100644 --- a/src/strife/p_user.c +++ b/src/strife/p_user.c @@ -537,9 +537,13 @@ void P_PlayerThink (player_t* player) // char* P_RemoveInventoryItem(player_t *player, int slot, int amount) { + mobjtype_t type; + player->inventory[slot].amount -= amount; player->st_update = true; + type = player->inventory[slot].type; + if(!player->inventory[slot].amount) { // shift everything above it down @@ -566,7 +570,7 @@ char* P_RemoveInventoryItem(player_t *player, int slot, int amount) } } - return mobjinfo[player->inventory[slot].type].name; + return mobjinfo[type].name; } // |