summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-17 22:07:11 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-17 22:07:11 +0200
commit9330b50231cb038295681874c3060aa97689f31d (patch)
tree60283ab807e32b722ccade2a1c38646aeaaf89d1 /src/net/tmwa
parentabeb003b88cc49ba70cdadd2e3adec6eca1751ec (diff)
downloadmanaverse-9330b50231cb038295681874c3060aa97689f31d.tar.gz
manaverse-9330b50231cb038295681874c3060aa97689f31d.tar.bz2
manaverse-9330b50231cb038295681874c3060aa97689f31d.tar.xz
manaverse-9330b50231cb038295681874c3060aa97689f31d.zip
Move direction calucaltion to Being method.
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)
{