summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-16 21:37:31 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-16 21:37:31 +0100
commit6846acdcf0159423c188b56fc4a5f4c19f123eb7 (patch)
tree6dcaf3927a6223365d7f052f2415fa9552b18662
parent786df24ec5d10e4251fa69426c53f9c2e5d545f4 (diff)
downloadmana-6846acdcf0159423c188b56fc4a5f4c19f123eb7.tar.gz
mana-6846acdcf0159423c188b56fc4a5f4c19f123eb7.tar.bz2
mana-6846acdcf0159423c188b56fc4a5f4c19f123eb7.tar.xz
mana-6846acdcf0159423c188b56fc4a5f4c19f123eb7.zip
Fixed the bug with remote player movement animation,
by removing a now useless reset in the beinghandler. Also added checks for flawed directions.
-rw-r--r--src/being.cpp2
-rw-r--r--src/net/tmwa/beinghandler.cpp16
2 files changed, 10 insertions, 8 deletions
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);