summaryrefslogtreecommitdiff
path: root/src/strife
diff options
context:
space:
mode:
authorSamuel Villareal2010-09-11 21:16:28 +0000
committerSamuel Villareal2010-09-11 21:16:28 +0000
commitfd1f146713bfa70136284a33214be42467611af5 (patch)
treeeb65e74574ed71fa81d0ab486d573926e0aa4831 /src/strife
parent90c196e4eb1d079fa946e764ed72a9ecd2c86dac (diff)
downloadchocolate-doom-fd1f146713bfa70136284a33214be42467611af5.tar.gz
chocolate-doom-fd1f146713bfa70136284a33214be42467611af5.tar.bz2
chocolate-doom-fd1f146713bfa70136284a33214be42467611af5.zip
+ Fixed P_RemoveInventoryItem not returning the item's name properly
Subversion-branch: /branches/strife-branch Subversion-revision: 2066
Diffstat (limited to 'src/strife')
-rw-r--r--src/strife/p_user.c6
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;
}
//