summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);