From 735a152850846b203a3696c6644cf299f2093196 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 27 May 2013 13:17:51 +0300 Subject: Fix player sprites in disguise mode. Also fix animation for local player who disguised monster. For other players disguised monster animation is broken. --- src/net/ea/beinghandler.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/net/ea') diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index cb8a2fa28..71194520d 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -135,6 +135,9 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, uint32_t statusEffects = msg.readInt16(); // opt2 statusEffects |= (static_cast(msg.readInt16())) << 16; // option const int16_t job = msg.readInt16(); // class + int disguiseId = 0; + if (id == player_node->getId() && job >= 1000) + disguiseId = job; Being *dstBeing = actorSpriteManager->findBeing(id); @@ -255,7 +258,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, // reserving bits for future usage - if (dstBeing->getType() == ActorSprite::PLAYER) + if (!disguiseId && dstBeing->getType() == ActorSprite::PLAYER) { gender &= 3; dstBeing->setGender(Being::intToGender(gender)); @@ -295,9 +298,12 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, { uint16_t srcX, srcY, dstX, dstY; msg.readCoordinatePair(srcX, srcY, dstX, dstY); - dstBeing->setAction(Being::STAND); - dstBeing->setTileCoords(srcX, srcY); - dstBeing->setDestination(dstX, dstY); + if (!disguiseId) + { + dstBeing->setAction(Being::STAND); + dstBeing->setTileCoords(srcX, srcY); + dstBeing->setDestination(dstX, dstY); + } } else { -- cgit v1.2.3-70-g09d2