shithub: choc

Download patch

ref: fd1f146713bfa70136284a33214be42467611af5
parent: 90c196e4eb1d079fa946e764ed72a9ecd2c86dac
author: Samuel Villareal <svkaiser@gmail.com>
date: Sat Sep 11 17:16:28 EDT 2010

+ Fixed P_RemoveInventoryItem not returning the item's name properly

Subversion-branch: /branches/strife-branch
Subversion-revision: 2066

--- a/src/strife/p_user.c
+++ b/src/strife/p_user.c
@@ -537,9 +537,13 @@
 //
 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 @@
         }
     }
 
-    return mobjinfo[player->inventory[slot].type].name;
+    return mobjinfo[type].name;
 }
 
 //