summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-27 13:17:51 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-27 14:18:19 +0300
commit735a152850846b203a3696c6644cf299f2093196 (patch)
treeaff92dbd556d820eafdcf39982662c09bc4fc621
parentb4ec5a83cbb42213aef9874fb62bd0911ccbb5a0 (diff)
downloadmanaplus-735a152850846b203a3696c6644cf299f2093196.tar.gz
manaplus-735a152850846b203a3696c6644cf299f2093196.tar.bz2
manaplus-735a152850846b203a3696c6644cf299f2093196.tar.xz
manaplus-735a152850846b203a3696c6644cf299f2093196.zip
Fix player sprites in disguise mode.
Also fix animation for local player who disguised monster. For other players disguised monster animation is broken.
-rw-r--r--src/net/ea/beinghandler.cpp14
1 files changed, 10 insertions, 4 deletions
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<uint32_t>(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
{