diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-07 10:37:54 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-02-07 10:37:54 +0000 |
commit | ac08acd4b4029a2519c81eecf938e1c03b51233c (patch) | |
tree | 78405d149cff52b310343a1e557062345b784d41 /src/net/protocol.cpp | |
parent | c395103a0f190598e234b2c5f373d3fde25f77cf (diff) | |
download | mana-client-ac08acd4b4029a2519c81eecf938e1c03b51233c.tar.gz mana-client-ac08acd4b4029a2519c81eecf938e1c03b51233c.tar.bz2 mana-client-ac08acd4b4029a2519c81eecf938e1c03b51233c.tar.xz mana-client-ac08acd4b4029a2519c81eecf938e1c03b51233c.zip |
Made the being directions being stored in a bitfield.
Diffstat (limited to 'src/net/protocol.cpp')
-rw-r--r-- | src/net/protocol.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp index f31d4a39..d3db50bf 100644 --- a/src/net/protocol.cpp +++ b/src/net/protocol.cpp @@ -43,5 +43,37 @@ void set_coordinates(char *data, 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 = (unsigned char)-1; + } data[2] |= direction; } |