diff options
Diffstat (limited to 'src/net/ea/beinghandler.cpp')
-rw-r--r-- | src/net/ea/beinghandler.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index 932f88d9..45e58dee 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -111,7 +111,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) Being *srcBeing, *dstBeing; Player *player; int hairStyle, hairColor, flag; - + std::string player_followed; + switch (msg.getId()) { case SMSG_BEING_VISIBLE: @@ -218,7 +219,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) dstBeing->setDirection(dir); } - msg.readInt8(); // unknown +// msg.readInt8(); // unknown msg.readInt8(); // unknown msg.readInt8(); // unknown / sit @@ -262,6 +263,16 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) if (!dstBeing) break; + + player_followed = player_node->getFollow(); + + if (!player_followed.empty()) + { + if (dstBeing->getName() == player_followed) + { + player_node->setDestination(player_node->getNextDestX(), player_node->getNextDestY()); + } + } // If this is player's current target, clear it. if (dstBeing == player_node->getTarget()) @@ -554,6 +565,16 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) msg.readCoordinatePair(srcX, srcY, dstX, dstY); dstBeing->setTileCoords(srcX, srcY); dstBeing->setDestination(dstX, dstY); + + player_followed = player_node->getFollow(); + if (!player_followed.empty()) + { + if (dstBeing->getName() == player_followed) + { + player_node->setNextDest(dstX, dstY); + player_node->setDestination(srcX, srcY); + } + } } else { |