summaryrefslogtreecommitdiff
path: root/src/net/messagein.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r--src/net/messagein.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 8f177f906..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<unsigned short>(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<int>(x))
- + "," + toString(static_cast<int>(y)));
+ + "," + toString(static_cast<int>(y)) + "," + toString(
+ static_cast<int>(serverDir)));
}
void MessageIn::readCoordinatePair(Uint16 &srcX, Uint16 &srcY,
@@ -227,7 +229,7 @@ std::string MessageIn::readRawString(int length)
char const *stringEnd2
= static_cast<char const *>(memchr(stringBeg2, '\0', len2));
std::string hiddenPart = std::string(stringBeg2,
- stringEnd2 ? stringEnd2 - stringBeg2 : len2);
+ stringEnd2 ? stringEnd2 - stringBeg2 : len2);
if (hiddenPart.length() > 0)
{
DEBUGLOG("readString2: " + hiddenPart);