diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2006-12-06 00:26:05 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2006-12-06 00:26:05 +0000 |
commit | d46fffe086d28b47e359f6fddffd88a0a993b27b (patch) | |
tree | 5cd2ceb4619b9be2174c172cb33a45e25b782fef | |
parent | 3f81292e7b98817575b7830b218845d63e38dcd2 (diff) | |
download | mana-client-d46fffe086d28b47e359f6fddffd88a0a993b27b.tar.gz mana-client-d46fffe086d28b47e359f6fddffd88a0a993b27b.tar.bz2 mana-client-d46fffe086d28b47e359f6fddffd88a0a993b27b.tar.xz mana-client-d46fffe086d28b47e359f6fddffd88a0a993b27b.zip |
Fixed crashs when changing equipment.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/net/beinghandler.cpp | 45 |
2 files changed, 23 insertions, 26 deletions
@@ -1,3 +1,7 @@ +2006-12-06 Philipp Sehmisch <tmw@crushnet.org> + + * src/net/beinghandler.cpp: Fixed crashs when changing equipment. + 2006-12-06 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/gui/item_amount.cpp: Fixed visibility of item amount window. diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 3fe3059d..46c44664 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -242,42 +242,35 @@ void BeingHandler::handleMessage(MessageIn *msg) } int type = msg->readInt8(); + int id = msg->readInt8(); switch (type) { case 1: - dstBeing->setHairStyle(msg->readInt8()); + dstBeing->setHairStyle(id); break; case 2: - dstBeing->setWeapon(msg->readInt8()); + dstBeing->setWeapon(id); break; - case 3: - case 4: - case 5: - // Equip/unequip head 3. Bottom 4. Top 5. Middle - switch (msg->readInt8()) - { - case 3: - dstBeing->setVisibleEquipment( - Being::BOTTOMCLOTHES_SPRITE, - msg->readInt8()); - break; - case 4: - dstBeing->setVisibleEquipment( - Being::HAT_SPRITE, - msg->readInt8()); - break; - case 5: - dstBeing->setVisibleEquipment( - Being::TOPCLOTHES_SPRITE, - msg->readInt8()); - break; - } + case 3: // Change lower headgear for eAthena, pants for us + dstBeing->setVisibleEquipment( + Being::BOTTOMCLOTHES_SPRITE, + id); + break; + case 4: // Change upper headgear for eAthena, hat for us + dstBeing->setVisibleEquipment( + Being::HAT_SPRITE, + id); + break; + case 5: // Change middle headgear for eathena, armor for us + dstBeing->setVisibleEquipment( + Being::TOPCLOTHES_SPRITE, + id); break; case 6: - dstBeing->setHairColor(msg->readInt8()); + dstBeing->setHairColor(id); break; default: - logger->log("c3: %i\n", msg->readInt8()); // unsupported + logger->log("c3: %i\n", id); // unsupported break; } } |