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/being.cpp | 2 +- src/net/tmwa/beinghandler.cpp | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 465cb088..2c8414d8 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -635,7 +635,7 @@ void Being::setAction(Action action, int attackType) void Being::setDirection(Uint8 direction) { - if (mDirection == direction) + if (!direction || mDirection == direction) return; mDirection = direction; 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