From a6dc253a3857ae4a71cbe8f2c2f734dee402d01f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 12 Oct 2011 11:39:58 +0300 Subject: Fix logging direction in packets. --- src/net/messagein.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 0fbbd45c7..0fbf7162b 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -77,6 +77,7 @@ void MessageIn::readCoordinates(Uint16 &x, Uint16 &y) void MessageIn::readCoordinates(Uint16 &x, Uint16 &y, Uint8 &direction) { + Uint8 serverDir = 0; if (mPos + 3 <= mLength) { const char *data = mData + mPos; @@ -87,10 +88,10 @@ void MessageIn::readCoordinates(Uint16 &x, Uint16 &y, Uint8 &direction) temp = MAKEWORD(data[2] & 0x00f0, data[1] & 0x003f); y = static_cast(temp >> 4); - direction = data[2] & 0x000f; + serverDir = data[2] & 0x000f; // Translate from eAthena format - switch (direction) + switch (serverDir) { case 0: direction = 1; @@ -134,7 +135,8 @@ void MessageIn::readCoordinates(Uint16 &x, Uint16 &y, Uint8 &direction) mPos += 3; PacketCounters::incInBytes(3); DEBUGLOG("readCoordinates: " + toString(static_cast(x)) - + "," + toString(static_cast(y))); + + "," + toString(static_cast(y)) + "," + toString( + static_cast(serverDir))); } void MessageIn::readCoordinatePair(Uint16 &srcX, Uint16 &srcY, -- cgit v1.2.3-70-g09d2