summaryrefslogtreecommitdiff
path: root/src/net/tmwa/inventoryhandler.cpp
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/tmwa/inventoryhandler.cpp
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/tmwa/inventoryhandler.cpp')
-rw-r--r--src/net/tmwa/inventoryhandler.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index 46eb6258..4a46e475 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -174,17 +174,10 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
}
if (msg.getId() == SMSG_PLAYER_INVENTORY)
- {
- // Trick because arrows are not considered equipment
- bool isEquipment = arrow & 0x8000;
-
- inventory->setItem(index, itemId, amount, isEquipment);
- }
+ inventory->setItem(index, itemId, amount);
else
- {
mInventoryItems.push_back(InventoryItem(index, itemId,
amount, false));
- }
}
break;
@@ -228,11 +221,11 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
msg.readInt8(); // refine
for (int i = 0; i < 4; i++)
cards[i] = msg.readInt16();
- equipType = msg.readInt16();
+ msg.readInt16(); // EquipType
itemType = msg.readInt8();
{
- const ItemInfo &itemInfo = ItemDB::get(itemId);
+ const ItemInfo &itemInfo = itemDb->get(itemId);
if (msg.readInt8() > 0)
{
@@ -247,7 +240,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
if (item && item->getId() == itemId)
amount += inventory->getItem(index)->getQuantity();
- inventory->setItem(index, itemId, amount, equipType != 0);
+ inventory->setItem(index, itemId, amount);
}
} break;
@@ -304,8 +297,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
InventoryItems::iterator it = mInventoryItems.begin();
InventoryItems::iterator it_end = mInventoryItems.end();
for (; it != it_end; it++)
- mStorage->setItem((*it).slot, (*it).id, (*it).quantity,
- (*it).equip);
+ mStorage->setItem((*it).slot, (*it).id, (*it).quantity);
mInventoryItems.clear();
if (!mStorageWindow)
@@ -330,9 +322,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
item->increaseQuantity(amount);
}
else
- {
- mStorage->setItem(index, itemId, amount, false);
- }
+ mStorage->setItem(index, itemId, amount);
break;
case SMSG_PLAYER_STORAGE_REMOVE:
@@ -374,7 +364,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
msg.readInt8(); // refine
msg.skip(8); // card
- inventory->setItem(index, itemId, 1, true);
+ inventory->setItem(index, itemId, 1);
if (equipType)
{