diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-10-17 22:07:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-10-17 22:07:24 +0300 |
commit | d14bb7a27ee23cc83b3af1db2f1976eaaa55d78a (patch) | |
tree | 5f128768c66436eefd70632f02889607596609d4 /src/net/messagein.cpp | |
parent | f1e92aca00a4859047e83fab76220767b9a2f814 (diff) | |
parent | e93e6beb456d105987da3190c2a80847b6900081 (diff) | |
download | plus-d14bb7a27ee23cc83b3af1db2f1976eaaa55d78a.tar.gz plus-d14bb7a27ee23cc83b3af1db2f1976eaaa55d78a.tar.bz2 plus-d14bb7a27ee23cc83b3af1db2f1976eaaa55d78a.tar.xz plus-d14bb7a27ee23cc83b3af1db2f1976eaaa55d78a.zip |
Merge branch 'master' into strippedstripped1.1.10.16
Conflicts:
data/fonts/mplus-1p-bold.ttf
data/fonts/mplus-1p-regular.ttf
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r-- | src/net/messagein.cpp | 10 |
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); |