summaryrefslogtreecommitdiff
path: root/src/equipment.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-11-06 17:44:35 +0000
committerIra Rice <irarice@gmail.com>2008-11-06 17:44:35 +0000
commit0db6dce98d9c07b569dd29207979818f114f7a32 (patch)
tree3ae317c611a6e1d530b7d5e2b693ffc554aaa920 /src/equipment.h
parentcb81caa6ddbe1861d7b276d48f337dd8841d68c1 (diff)
downloadmana-0db6dce98d9c07b569dd29207979818f114f7a32.tar.gz
mana-0db6dce98d9c07b569dd29207979818f114f7a32.tar.bz2
mana-0db6dce98d9c07b569dd29207979818f114f7a32.tar.xz
mana-0db6dce98d9c07b569dd29207979818f114f7a32.zip
Ported a patch by Peavey on TMW to keep all item pointers inside of
inventory. For us, this should get rid of the arrow crashing bug, if it still exists (been a few weeks since I've heard of it happening now).
Diffstat (limited to 'src/equipment.h')
-rw-r--r--src/equipment.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/equipment.h b/src/equipment.h
index 7977894a..8b2ce127 100644
--- a/src/equipment.h
+++ b/src/equipment.h
@@ -24,8 +24,6 @@
#ifndef _TMW_EQUIPMENT_H_
#define _TMW_EQUIPMENT_H_
-#include <guichan/actionlistener.hpp>
-
class Item;
#define EQUIPMENT_SIZE 10
@@ -41,41 +39,36 @@ class Equipment
/**
* Get equipment at the given slot.
*/
- Item* getEquipment(int index) const
+ int getEquipment(int index) const
{ return mEquipment[index]; }
/**
* Set equipment at the given slot.
*/
void
- setEquipment(int index, Item *item);
+ setEquipment(int index, int inventoryIndex);
/**
* Remove equipment from the given slot.
*/
void
- removeEquipment(int index);
-
- /**
- * Remove the given item from equipment.
- */
- void removeEquipment(Item *item);
+ removeEquipment(int index) { mEquipment[index] = 0; }
/**
* Get the item used in the arrow slot.
*/
- Item*
+ int
getArrows() { return mArrows; }
/**
* Set the item used in the arrow slot.
*/
void
- setArrows(Item *arrows) {mArrows = arrows;}
+ setArrows(int arrows) {mArrows = arrows;}
private:
- Item *mEquipment[EQUIPMENT_SIZE];
- Item *mArrows;
+ int mEquipment[EQUIPMENT_SIZE];
+ int mArrows;
};
#endif