From ac08acd4b4029a2519c81eecf938e1c03b51233c Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Tue, 7 Feb 2006 10:37:54 +0000 Subject: Made the being directions being stored in a bitfield. --- src/net/messagein.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/net/messagein.cpp') diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 9f2b38f7..9abe4a2d 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -87,6 +87,38 @@ MessageIn::readCoordinates(Uint16 &x, Uint16 &y, Uint8 &direction) direction = data[2] & 0x000f; + // Translate from eAthena format + switch (direction) + { + case 0: + direction = 1; + break; + case 1: + direction = 3; + break; + case 2: + direction = 2; + break; + case 3: + direction = 6; + break; + case 4: + direction = 4; + break; + case 5: + direction = 12; + break; + case 6: + direction = 8; + break; + case 7: + direction = 9; + break; + default: + // OOPSIE! Impossible or unknown + direction = 0; + } + mPos += 3; } -- cgit v1.2.3-70-g09d2