diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-17 22:07:11 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-17 22:07:11 +0200 |
commit | 9330b50231cb038295681874c3060aa97689f31d (patch) | |
tree | 60283ab807e32b722ccade2a1c38646aeaaf89d1 /src/net/tmwa/beinghandler.cpp | |
parent | abeb003b88cc49ba70cdadd2e3adec6eca1751ec (diff) | |
download | mv-9330b50231cb038295681874c3060aa97689f31d.tar.gz mv-9330b50231cb038295681874c3060aa97689f31d.tar.bz2 mv-9330b50231cb038295681874c3060aa97689f31d.tar.xz mv-9330b50231cb038295681874c3060aa97689f31d.zip |
Move direction calucaltion to Being method.
Diffstat (limited to 'src/net/tmwa/beinghandler.cpp')
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 10 |
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) { |