summaryrefslogtreecommitdiff
path: root/src/net/manaserv/inventoryhandler.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-08-26 16:55:05 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-08-26 16:55:05 +0200
commit6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d (patch)
tree4e6e178095ac8cf89dc0dba4f532913891305436 /src/net/manaserv/inventoryhandler.h
parentee8f131b49bb9b1d66cac3840b3c566eb49bcf3f (diff)
downloadmana-6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d.tar.gz
mana-6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d.tar.bz2
mana-6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d.tar.xz
mana-6d9dbf93e6c0247cb9b19d3f52a1837a5833b22d.zip
Merged testing branch into master.
Diffstat (limited to 'src/net/manaserv/inventoryhandler.h')
-rw-r--r--src/net/manaserv/inventoryhandler.h24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h
index a1673e99..aa44f2ee 100644
--- a/src/net/manaserv/inventoryhandler.h
+++ b/src/net/manaserv/inventoryhandler.h
@@ -38,30 +38,20 @@ class EquipBackend : public Equipment::Backend
{ memset(mEquipment, 0, sizeof(mEquipment)); }
Item *getEquipment(int index) const
- { return mEquipment[index]; }
+ { return 0; }
void clear()
{
- for (int i = 0; i < EQUIPMENT_SIZE; ++i)
- delete mEquipment[i];
+ }
- std::fill_n(mEquipment, EQUIPMENT_SIZE, (Item*) 0);
+ void setEquipment(unsigned int slot, unsigned int used, int reference)
+ {
+ printf("Equip: %d at %dx%d\n", reference, slot, used);
}
- void setEquipment(int index, int id, int quantity = 0)
+ void addEquipment(unsigned int slot, int reference)
{
- if (mEquipment[index] && mEquipment[index]->getId() == id)
- return;
-
- delete mEquipment[index];
- mEquipment[index] = (id > 0) ? new Item(id, quantity) : 0;
-
- if (mEquipment[index])
- {
- mEquipment[index]->setInvIndex(index);
- mEquipment[index]->setEquipped(true);
- mEquipment[index]->setInEquipment(true);
- }
+ printf("Equip: %d at %d\n", reference, slot);
}
private: