summaryrefslogtreecommitdiff
path: root/src/net/eathena/messageout.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-22 15:56:51 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-22 15:56:51 +0300
commit9239957b3a21a1498323b7af2b2910bc75f72859 (patch)
tree5cc784d0a29c0d452baf75b3023783db488d3530 /src/net/eathena/messageout.cpp
parentc8c04113ea360bdf542393001e45eb1ea9f317d1 (diff)
downloadManaVerse-9239957b3a21a1498323b7af2b2910bc75f72859.tar.gz
ManaVerse-9239957b3a21a1498323b7af2b2910bc75f72859.tar.bz2
ManaVerse-9239957b3a21a1498323b7af2b2910bc75f72859.tar.xz
ManaVerse-9239957b3a21a1498323b7af2b2910bc75f72859.zip
add function for convert server direction into client direction.
Diffstat (limited to 'src/net/eathena/messageout.cpp')
-rw-r--r--src/net/eathena/messageout.cpp34
1 files changed, 1 insertions, 33 deletions
diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp
index be3fb7172..adf9d17f7 100644
--- a/src/net/eathena/messageout.cpp
+++ b/src/net/eathena/messageout.cpp
@@ -115,39 +115,7 @@ void MessageOut::writeCoordinates(const uint16_t x,
temp <<= 4;
data[1] |= HIBYTE(temp);
data[2] = LOBYTE(temp);
-
- // Translate direction to eAthena format
- switch (direction)
- {
- case 1:
- direction = 0;
- break;
- case 3:
- direction = 1;
- break;
- case 2:
- direction = 2;
- break;
- case 6:
- direction = 3;
- break;
- case 4:
- direction = 4;
- break;
- case 12:
- direction = 5;
- break;
- case 8:
- direction = 6;
- break;
- case 9:
- direction = 7;
- break;
- default:
- // OOPSIE! Impossible or unknown
- direction = static_cast<unsigned char>(-1);
- break;
- }
+ direction = toServerDirection(direction);
data[2] |= direction;
PacketCounters::incOutBytes(3);
}