summaryrefslogtreecommitdiff
path: root/src/net/eathena/beinghandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-04 23:34:40 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:57 +0300
commit0aa42c773981f5f99e1fcd394725cd9da1e42fc1 (patch)
tree498efad82d0e0e230b081803851a173bc5053f7d /src/net/eathena/beinghandler.cpp
parent523a532a746ba8ae51d1380ef9a29bcdc7ec3136 (diff)
downloadmv-0aa42c773981f5f99e1fcd394725cd9da1e42fc1.tar.gz
mv-0aa42c773981f5f99e1fcd394725cd9da1e42fc1.tar.bz2
mv-0aa42c773981f5f99e1fcd394725cd9da1e42fc1.tar.xz
mv-0aa42c773981f5f99e1fcd394725cd9da1e42fc1.zip
eathena: fix packet SMSG_BEING_SPAWN 0x0858.
Diffstat (limited to 'src/net/eathena/beinghandler.cpp')
-rw-r--r--src/net/eathena/beinghandler.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 0593871c7..1d75bbe62 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -108,8 +108,9 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
{
switch (msg.getId())
{
- case SMSG_BEING_VISIBLE: // changed
+ case SMSG_BEING_VISIBLE:
case SMSG_BEING_MOVE:
+ case SMSG_BEING_SPAWN:
processBeingVisibleOrMove(msg);
break;
@@ -117,10 +118,6 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
processBeingMove2(msg);
break;
- case SMSG_BEING_SPAWN: // changed
- processBeingSpawn(msg);
- break;
-
case SMSG_BEING_REMOVE:
processBeingRemove(msg);
break;
@@ -637,6 +634,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg)
return;
const bool visible = msg.getId() == SMSG_BEING_VISIBLE;
+ const bool spawn = msg.getId() == SMSG_BEING_SPAWN;
msg.readInt16("len");
msg.readUInt8("object type");
@@ -644,11 +642,19 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg)
// Information about a being in range
const int id = msg.readInt32("being id");
int spawnId;
- if (id == mSpawnId)
- spawnId = mSpawnId;
+ if (spawn)
+ {
+ mSpawnId = id;
+ spawnId = id;
+ }
else
- spawnId = 0;
- mSpawnId = 0;
+ {
+ if (id == mSpawnId)
+ spawnId = mSpawnId;
+ else
+ spawnId = 0;
+ mSpawnId = 0;
+ }
int16_t speed = msg.readInt16("speed");
// if (visible)
// {
@@ -784,7 +790,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg)
}
}
- if (!visible)
+ if (!visible && !spawn)
{
uint16_t srcX, srcY, dstX, dstY;
msg.readCoordinatePair(srcX, srcY, dstX, dstY, "move path");
@@ -801,7 +807,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg)
msg.readCoordinates(x, y, dir, "position");
msg.readInt8("xs");
msg.readInt8("ys");
- msg.readUInt8("action type");
+ if (visible)
+ msg.readUInt8("action type");
dstBeing->setTileCoords(x, y);
if (job == 45 && socialWindow && outfitWindow)