summaryrefslogtreecommitdiff
path: root/src/net/equipmenthandler.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-10-01 18:04:15 +0000
committerIra Rice <irarice@gmail.com>2008-10-01 18:04:15 +0000
commitad4b0d0b8e32e61798ade9c256f850e8f96575f3 (patch)
tree3a6a97681d3cd91fbfb5047db5256a1c28373546 /src/net/equipmenthandler.cpp
parent9dd496ef1a395cada1f7fec08d4785728b2602d2 (diff)
downloadmana-ad4b0d0b8e32e61798ade9c256f850e8f96575f3.tar.gz
mana-ad4b0d0b8e32e61798ade9c256f850e8f96575f3.tar.bz2
mana-ad4b0d0b8e32e61798ade9c256f850e8f96575f3.tar.xz
mana-ad4b0d0b8e32e61798ade9c256f850e8f96575f3.zip
Possible fix for the arrow crashing bug. Confirmation needed.
Diffstat (limited to 'src/net/equipmenthandler.cpp')
-rw-r--r--src/net/equipmenthandler.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/net/equipmenthandler.cpp b/src/net/equipmenthandler.cpp
index 0fc98175..b5c9fe2b 100644
--- a/src/net/equipmenthandler.cpp
+++ b/src/net/equipmenthandler.cpp
@@ -146,22 +146,22 @@ void EquipmentHandler::handleMessage(MessageIn *msg)
break;
}
- if (equipPoint & 0x8000) { // Arrows
- player_node->mEquipment->setArrows(NULL);
- position = 11;
- } else {
- mask = 1;
- position = 0;
- while (!(equipPoint & mask)) {
- mask <<= 1;
- position++;
- }
+ mask = 1;
+ position = 0;
+ while (!(equipPoint & mask)) {
+ mask <<= 1;
+ position++;
+ }
- item = inventory->getItem(index);
- if (!item)
- break;
+ item = inventory->getItem(index);
+ if (!item)
+ break;
- item->setEquipped(false);
+ item->setEquipped(false);
+ if (equipPoint & 0x8000) { // Arrows
+ player_node->mEquipment->setArrows(NULL);
+ }
+ else {
player_node->mEquipment->removeEquipment(position);
}
logger->log("Unequipping: %i %i(%i) %i",