From fd1f146713bfa70136284a33214be42467611af5 Mon Sep 17 00:00:00 2001 From: Samuel Villareal Date: Sat, 11 Sep 2010 21:16:28 +0000 Subject: + Fixed P_RemoveInventoryItem not returning the item's name properly Subversion-branch: /branches/strife-branch Subversion-revision: 2066 --- src/strife/p_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/strife') 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; } // -- cgit v1.2.3