summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-27 19:03:49 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-27 19:03:49 +0300
commitc77f06f7b80a67c842abe837beb2f22e9ecf60cc (patch)
tree65da775f4830fde8ccbf7a6d7514e42169321486 /src/net/ea
parent8836d01c806f7d7e99befb5036148e8ff7b0e24e (diff)
downloadplus-c77f06f7b80a67c842abe837beb2f22e9ecf60cc.tar.gz
plus-c77f06f7b80a67c842abe837beb2f22e9ecf60cc.tar.bz2
plus-c77f06f7b80a67c842abe837beb2f22e9ecf60cc.tar.xz
plus-c77f06f7b80a67c842abe837beb2f22e9ecf60cc.zip
Add ArrowsListener.
Also fix arrows amount update on arrows pickup.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/inventoryhandler.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index ea7390ccb..d1dd5cf7d 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -35,6 +35,8 @@
#include "utils/delete2.h"
+#include "listeners/arrowslistener.h"
+
#include "debug.h"
extern int serverVersion;
@@ -336,6 +338,7 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
inventory->setItem(index, itemId, amount, refine,
identified, equipType != 0);
}
+ ArrowsListener::distributeEvent();
}
}
@@ -353,8 +356,7 @@ void InventoryHandler::processPlayerInventoryRemove(Net::MessageIn &msg)
item->increaseQuantity(-amount);
if (item->getQuantity() == 0)
inventory->removeItemAt(index);
- if (miniStatusWindow)
- miniStatusWindow->updateArrows();
+ ArrowsListener::distributeEvent();
}
}
}
@@ -566,8 +568,8 @@ void InventoryHandler::processPlayerUnEquip(Net::MessageIn &msg)
if (flag)
mEquips.setEquipment(getSlot(equipType), -1);
- if (miniStatusWindow && equipType & 0x8000)
- miniStatusWindow->updateArrows();
+ if (equipType & 0x8000)
+ ArrowsListener::distributeEvent();
}
void InventoryHandler::processPlayerAttackRange(Net::MessageIn &msg)
@@ -586,11 +588,8 @@ void InventoryHandler::processPlayerArrowEquip(Net::MessageIn &msg)
return;
index -= INVENTORY_OFFSET;
-
mEquips.setEquipment(Equipment::EQUIP_PROJECTILE_SLOT, index);
-
- if (miniStatusWindow)
- miniStatusWindow->updateArrows();
+ ArrowsListener::distributeEvent();
}
void InventoryHandler::closeStorage()