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 /src/net | |
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.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/beinghandler.cpp | 45 |
1 files changed, 19 insertions, 26 deletions
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; } } |