summaryrefslogtreecommitdiff
path: root/src/net/tmwa/inventoryhandler.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-19 02:37:09 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-19 02:37:09 +0200
commit27114fa2694318f2a1c56cb828a3b79731efcb74 (patch)
treeaad31af84a5932bf8fda83e367dfa1ac78fec1c3 /src/net/tmwa/inventoryhandler.h
parent36239b2d689b862a951a65a9be7376a500f1ace9 (diff)
downloadmana-client-27114fa2694318f2a1c56cb828a3b79731efcb74.tar.gz
mana-client-27114fa2694318f2a1c56cb828a3b79731efcb74.tar.bz2
mana-client-27114fa2694318f2a1c56cb828a3b79731efcb74.tar.xz
mana-client-27114fa2694318f2a1c56cb828a3b79731efcb74.zip
Fixed visible equipment updates, and made it based on equip.xml.
Diffstat (limited to 'src/net/tmwa/inventoryhandler.h')
-rw-r--r--src/net/tmwa/inventoryhandler.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h
index 44ddd896..4c29e95b 100644
--- a/src/net/tmwa/inventoryhandler.h
+++ b/src/net/tmwa/inventoryhandler.h
@@ -127,6 +127,18 @@ class EquipBackend : public Equipment::Backend
int getSlotNumber() const
{ return EQUIP_VECTOR_END; }
+ // Note the slot type id is equal to the slot Index for tA.
+ bool isWeaponSlot(unsigned int slotTypeId) const
+ {
+ return (slotTypeId == EQUIP_FIGHT1_SLOT
+ || slotTypeId == EQUIP_FIGHT1_SLOT);
+ }
+
+ bool isAmmoSlot(unsigned int slotTypeId) const
+ {
+ return (slotTypeId == EQUIP_PROJECTILE_SLOT);
+ }
+
private:
int mEquipment[EQUIP_VECTOR_END];
};
@@ -174,6 +186,12 @@ class InventoryHandler : public MessageHandler, public Net::InventoryHandler,
size_t getSize(int type) const;
+ bool isWeaponSlot(unsigned int slotTypeId) const
+ { return mEquips.isWeaponSlot(slotTypeId); }
+
+ bool isAmmoSlot(unsigned int slotTypeId) const
+ { return mEquips.isAmmoSlot(slotTypeId); }
+
private:
EquipBackend mEquips;
InventoryItems mInventoryItems;