diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-04 23:06:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:57 +0300 |
commit | 523a532a746ba8ae51d1380ef9a29bcdc7ec3136 (patch) | |
tree | ff06e20715d743165d25d6c3f04d9797f7aedfe0 /src/net | |
parent | f446119f951b17b80969ee7eb485702b97a317cf (diff) | |
download | plus-523a532a746ba8ae51d1380ef9a29bcdc7ec3136.tar.gz plus-523a532a746ba8ae51d1380ef9a29bcdc7ec3136.tar.bz2 plus-523a532a746ba8ae51d1380ef9a29bcdc7ec3136.tar.xz plus-523a532a746ba8ae51d1380ef9a29bcdc7ec3136.zip |
eathena: fix packet SMSG_BEING_MOVE 0x0856.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 39 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 2 |
3 files changed, 29 insertions, 14 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 228e2ce6a..0593871c7 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -638,11 +638,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg) const bool visible = msg.getId() == SMSG_BEING_VISIBLE; - if (visible) - { - msg.readInt16("len"); - msg.readUInt8("object type"); - } + msg.readInt16("len"); + msg.readUInt8("object type"); // Information about a being in range const int id = msg.readInt32("being id"); @@ -653,10 +650,23 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg) spawnId = 0; mSpawnId = 0; int16_t speed = msg.readInt16("speed"); - const uint16_t stunMode = msg.readInt16("opt1"); - // probably wrong effect usage - uint32_t statusEffects = msg.readInt16("opt2"); - msg.readInt32("option"); +// if (visible) +// { + const uint16_t stunMode = msg.readInt16("opt1"); + // probably wrong effect usage + uint32_t statusEffects = msg.readInt16("opt2"); +// } +// else +// { +// commented for now, probably it can be removed after testing +// msg.readInt16("body state"); +// msg.readInt16("health state"); +// } + if (visible) + msg.readInt32("option"); + else + msg.readInt32("effect state"); + const int16_t job = msg.readInt16("class"); Being *dstBeing = actorManager->findBeing(id); @@ -721,7 +731,9 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg) const uint32_t weapon = static_cast<uint32_t>(msg.readInt32("weapon")); const uint16_t headBottom = msg.readInt16("head bottom"); -// const uint16_t shield = msg.readInt16("shield"); + if (!visible) + msg.readInt32("tick"); + const uint16_t headTop = msg.readInt16("head top"); const uint16_t headMid = msg.readInt16("head mid"); const int hairColor = msg.readInt16("hair color"); @@ -776,6 +788,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg) { uint16_t srcX, srcY, dstX, dstY; msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path"); + msg.readInt8("xs"); + msg.readInt8("ys"); dstBeing->setAction(BeingAction::STAND, 0); dstBeing->setTileCoords(srcX, srcY); dstBeing->setDestination(dstX, dstY); @@ -787,6 +801,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg) msg.readCoordinates(x, y, dir, "position"); msg.readInt8("xs"); msg.readInt8("ys"); + msg.readUInt8("action type"); dstBeing->setTileCoords(x, y); if (job == 45 && socialWindow && outfitWindow) @@ -806,13 +821,13 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg) dstBeing->setDirection(dir); } - msg.readUInt8("action type"); - const int level = static_cast<int>(msg.readInt16("level")); if (level) dstBeing->setLevel(level); msg.readInt16("font"); + // here map hp/hp for PACKETVER >= 20150000 for now unsupported + dstBeing->setStunMode(stunMode); dstBeing->setStatusEffectBlock(0, static_cast<uint16_t>( (statusEffects >> 16) & 0xffffU)); diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 16f507403..6bffb0948 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -221,7 +221,7 @@ int16_t packet_lengths[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, // #0x0840 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0880 diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 527d8b99e..c01feb0c4 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -87,7 +87,7 @@ #define SMSG_ITEM_DROPPED 0x084b /**< An item is dropped */ #define SMSG_ITEM_REMOVE 0x00a1 /**< An item disappers */ #define SMSG_BEING_VISIBLE 0x0857 -#define SMSG_BEING_MOVE 0x007b /**< A nearby monster moves */ +#define SMSG_BEING_MOVE 0x0856 /**< A nearby monster moves */ #define SMSG_BEING_SPAWN 0x007c /**< A being spawns nearby */ #define SMSG_BEING_MOVE2 0x0086 /**< New eAthena being moves */ #define SMSG_BEING_REMOVE 0x0080 |