summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-11-06 17:44:35 +0000
committerIra Rice <irarice@gmail.com>2008-11-06 17:44:35 +0000
commit0db6dce98d9c07b569dd29207979818f114f7a32 (patch)
tree3ae317c611a6e1d530b7d5e2b693ffc554aaa920 /src/net
parentcb81caa6ddbe1861d7b276d48f337dd8841d68c1 (diff)
downloadmana-0db6dce98d9c07b569dd29207979818f114f7a32.tar.gz
mana-0db6dce98d9c07b569dd29207979818f114f7a32.tar.bz2
mana-0db6dce98d9c07b569dd29207979818f114f7a32.tar.xz
mana-0db6dce98d9c07b569dd29207979818f114f7a32.zip
Ported a patch by Peavey on TMW to keep all item pointers inside of
inventory. For us, this should get rid of the arrow crashing bug, if it still exists (been a few weeks since I've heard of it happening now).
Diffstat (limited to 'src/net')
-rw-r--r--src/net/equipmenthandler.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net/equipmenthandler.cpp b/src/net/equipmenthandler.cpp
index b5c9fe2b..5464fa55 100644
--- a/src/net/equipmenthandler.cpp
+++ b/src/net/equipmenthandler.cpp
@@ -87,7 +87,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg)
position++;
}
item = inventory->getItem(index);
- player_node->mEquipment->setEquipment(position, item);
+ player_node->mEquipment->setEquipment(position, index);
}
}
break;
@@ -120,7 +120,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg)
position++;
}
logger->log("Position %i", position);
- item = player_node->mEquipment->getEquipment(position);
+ item = player_node->getInventory()->getItem(player_node->mEquipment->getEquipment(position));
// Unequip any existing equipped item in this position
if (item) {
@@ -128,7 +128,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg)
}
item = inventory->getItem(index);
- player_node->mEquipment->setEquipment(position, item);
+ player_node->mEquipment->setEquipment(position, index);
break;
case SMSG_PLAYER_UNEQUIP:
@@ -181,7 +181,7 @@ void EquipmentHandler::handleMessage(MessageIn *msg)
item = inventory->getItem(index);
if (item) {
item->setEquipped(true);
- player_node->mEquipment->setArrows(item);
+ player_node->mEquipment->setArrows(index);
logger->log("Arrows equipped: %i", index);
}
break;