foxygit / doom Log in
commit fd1f146713bfa70136284a33214be42467611af5
Author:     Samuel Villareal <svkaiser@gmail.com>
AuthorDate: Sat Sep 11 21:16:28 2010 +0000
Commit:     Samuel Villareal <svkaiser@gmail.com>
CommitDate: Sat Sep 11 21:16:28 2010 +0000

    + 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(-)

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;
 }

 //