summaryrefslogtreecommitdiff
path: root/src/net/messagein.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-21 13:30:39 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-21 13:30:39 +0300
commit1fcc02e803d83ae8415ff44f9696cb215f475daa (patch)
tree3c4ccb5160624db095a139cb5a81a982e156d81c /src/net/messagein.cpp
parent126fa885664da8a8de86f3a38c04469f7006e447 (diff)
downloadManaVerse-1fcc02e803d83ae8415ff44f9696cb215f475daa.tar.gz
ManaVerse-1fcc02e803d83ae8415ff44f9696cb215f475daa.tar.bz2
ManaVerse-1fcc02e803d83ae8415ff44f9696cb215f475daa.tar.xz
ManaVerse-1fcc02e803d83ae8415ff44f9696cb215f475daa.zip
fix signed shifts.
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r--src/net/messagein.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 9d9c68b94..81340ba33 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -115,7 +115,7 @@ void MessageIn::readCoordinates(uint16_t &restrict x, uint16_t &restrict y,
if (mPos + 3 <= mLength)
{
const char *const data = mData + mPos;
- int16_t temp = MAKEWORD(data[1] & 0x00c0, data[0] & 0x00ff);
+ uint16_t temp = MAKEWORD(data[1] & 0x00c0, data[0] & 0x00ff);
x = static_cast<uint16_t>(temp >> 6);
temp = MAKEWORD(data[2] & 0x00f0, data[1] & 0x003f);
y = static_cast<uint16_t>(temp >> 4);
@@ -147,7 +147,7 @@ void MessageIn::readCoordinatePair(uint16_t &restrict srcX,
if (mPos + 5 <= mLength)
{
const char *const data = mData + mPos;
- int16_t temp = MAKEWORD(data[3], data[2] & 0x000f);
+ uint16_t temp = MAKEWORD(data[3], data[2] & 0x000f);
dstX = static_cast<uint16_t>(temp >> 2);
dstY = MAKEWORD(data[4], data[3] & 0x0003);