summaryrefslogtreecommitdiff
path: root/src/net/inventoryhandler.cpp
diff options
context:
space:
mode:
authorLloyd Bryant <lloyd_bryant@netzero.net>2008-08-18 00:04:30 +0000
committerLloyd Bryant <lloyd_bryant@netzero.net>2008-08-18 00:04:30 +0000
commit46074f67394f313331d13a5def4eb81ca92df576 (patch)
treee5c5fa2c4bd599657846918bdf88c27203a99eb6 /src/net/inventoryhandler.cpp
parentd5b86aa54dfa4ddf5b5f2361918c719ba8d0dd18 (diff)
downloadmana-46074f67394f313331d13a5def4eb81ca92df576.tar.gz
mana-46074f67394f313331d13a5def4eb81ca92df576.tar.bz2
mana-46074f67394f313331d13a5def4eb81ca92df576.tar.xz
mana-46074f67394f313331d13a5def4eb81ca92df576.zip
Fixed bugs with new arrow types
Diffstat (limited to 'src/net/inventoryhandler.cpp')
-rw-r--r--src/net/inventoryhandler.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp
index c0661710..37ae5fb9 100644
--- a/src/net/inventoryhandler.cpp
+++ b/src/net/inventoryhandler.cpp
@@ -55,7 +55,7 @@ InventoryHandler::InventoryHandler()
void InventoryHandler::handleMessage(MessageIn *msg)
{
Sint32 number;
- Sint16 index, amount, itemId, equipType;
+ Sint16 index, amount, itemId, equipType, arrow;
Inventory *inventory = player_node->getInventory();
switch (msg->getId())
@@ -67,21 +67,19 @@ void InventoryHandler::handleMessage(MessageIn *msg)
msg->readInt16(); // length
number = (msg->getLength() - 4) / 18;
- for (int loop = 0; loop < number; loop++)
- {
+ for (int loop = 0; loop < number; loop++) {
index = msg->readInt16();
itemId = msg->readInt16();
msg->readInt8(); // type
msg->readInt8(); // identify flag
amount = msg->readInt16();
- msg->skip(2); // unknown
+ arrow = msg->readInt16();
msg->skip(8); // card (4 shorts)
inventory->setItem(index, itemId, amount, false);
// Trick because arrows are not considered equipment
- if (itemId == 1199 || itemId == 529)
- {
+ if (arrow & 0x8000) {
if (Item *item = inventory->getItem(index))
item->setEquipment(true);
}