summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/beinghandler.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index fb3ac44be..74a620ce3 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -951,15 +951,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg)
if (srcX != dstX || srcY != dstY)
{
- int dir = 0;
- if (dstX > srcX)
- dir |= Being::RIGHT;
- else if (dstX < srcX)
- dir |= Being::LEFT;
- if (dstY > srcY)
- dir |= Being::DOWN;
- else if (dstY < srcY)
- dir |= Being::UP;
+ int dir = dstBeing->calcDirection(dstX, dstY);
if (dir && dstBeing->getDirection() != dir)
{