aboutsummaryrefslogtreecommitdiffstats
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-12-02 06:11:35 -0500
committerClyne Sullivan <tullivan99@gmail.com>2015-12-02 06:11:35 -0500
commit67ebafca971ecd4dcfde92bc64a838ba64c16e99 (patch)
tree047de504bb655358ded1f45770c91799aa1c4435 /src/inventory.cpp
parent8426dc094bf9a0da94c01e46bb34d7d95ba21548 (diff)
segfault fixes
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 28612ae..2af4de3 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -7,6 +7,10 @@
extern Player *player;
extern GLuint invUI;
+static Item item[5]= {
+ #include "../config/items.h"
+};
+
void itemDraw(Player *p,ITEM_ID id);
char *getItemTexturePath(ITEM_ID id){
@@ -27,7 +31,7 @@ Item::Item(ITEM_ID i, const char *n, ITEM_TYPE t, float w, float h, int m, const
strcpy(name,n);
strcpy(textureLoc,tl);
- tex= new Texturec(1,textureLoc);
+ //tex= new Texturec(1,textureLoc);
}
Inventory::Inventory(unsigned int s){
@@ -52,13 +56,14 @@ int Inventory::addItem(ITEM_ID id,unsigned char count){
os++;
- #ifdef DEBUG
- DEBUG_printf("Gave player %u more %s(s)(%d).\n",count,item[id].name,item[id].id);
- #endif // DEBUG
+#ifdef DEBUG
+ DEBUG_printf("Gave player %u more %s(s)(ID: %d).\n",count,item[id].name,item[id].id);
+#endif // DEBUG
- /*#ifdef DEBUG
+/*#ifdef DEBUG
DEBUG_printf("Failed to add non-existant item with id %u.\n",id);
- #endif // DEBUG*/
+#endif // DEBUG*/
+
return 0;
}