From 6846acdcf0159423c188b56fc4a5f4c19f123eb7 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 16 Mar 2011 21:37:31 +0100 Subject: Fixed the bug with remote player movement animation, by removing a now useless reset in the beinghandler. Also added checks for flawed directions. --- src/net/tmwa/beinghandler.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/net/tmwa/beinghandler.cpp') diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 40dfe083..cee915c7 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -248,7 +248,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) Vector pos(x * tileWidth + tileWidth / 2, y * tileHeight + tileHeight / 2); dstBeing->setPosition(pos); - dstBeing->setDirection(dir); + if (dir) + dstBeing->setDirection(dir); } } @@ -528,15 +529,17 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) } break; case SMSG_BEING_CHANGE_DIRECTION: + { if (!(dstBeing = actorSpriteManager->findBeing(msg.readInt32()))) { break; } msg.readInt16(); // unused - - dstBeing->setDirection(msg.readInt8()); - + Uint8 dir = msg.readInt8(); + if (dir) + dstBeing->setDirection(dir); + } break; case SMSG_PLAYER_UPDATE_1: @@ -646,7 +649,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) Vector pos(x * tileWidth + tileWidth / 2, y * tileHeight + tileHeight / 2); dstBeing->setPosition(pos); - dstBeing->setDirection(dir); + if (dir) + dstBeing->setDirection(dir); } } @@ -675,8 +679,6 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) msg.readInt8(); // Lv msg.readInt8(); // unknown - dstBeing->reset(); - dstBeing->setStunMode(stunMode); dstBeing->setStatusEffectBlock(0, (statusEffects >> 16) & 0xffff); dstBeing->setStatusEffectBlock(16, statusEffects & 0xffff); -- cgit v1.2.3-70-g09d2