summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2011-06-04 14:57:43 -0600
committerJared Adams <jaxad0127@gmail.com>2011-06-04 14:57:43 -0600
commita86402d7f0d0af16008f22cc9587127c334eab28 (patch)
treea3b3cb91cc67da70be56934ce0904991a5b8b170
parentd2c548e091f203196d93c011fc65944fb1cdc986 (diff)
downloadmana-client-a86402d7f0d0af16008f22cc9587127c334eab28.tar.gz
mana-client-a86402d7f0d0af16008f22cc9587127c334eab28.tar.bz2
mana-client-a86402d7f0d0af16008f22cc9587127c334eab28.tar.xz
mana-client-a86402d7f0d0af16008f22cc9587127c334eab28.zip
Revert "Fix sending coordinates for tmwAthena"
This reverts commit d2c548e091f203196d93c011fc65944fb1cdc986.
-rw-r--r--src/net/tmwa/messageout.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp
index 3197380b..705b9a96 100644
--- a/src/net/tmwa/messageout.cpp
+++ b/src/net/tmwa/messageout.cpp
@@ -68,27 +68,21 @@ void MessageOut::writeInt32(uint32_t value)
mPos += 4;
}
-#define LOBYTE(w) ((unsigned char)(w))
-#define HIBYTE(w) ((unsigned char)(((unsigned short)(w)) >> 8))
-
void MessageOut::writeCoordinates(uint16_t x, uint16_t y, uint8_t direction)
{
char *data = mData + mPos;
mNetwork->mOutSize += 3;
mPos += 3;
- short temp;
- temp = x;
+ int16_t temp = x;
temp <<= 6;
- data[0] = 0;
- data[1] = 1;
- data[2] = 2;
- data[0] = HIBYTE(temp);
- data[1] = (unsigned char) temp;
+ data[0] = temp >> 8;
+ data[1] = temp;
+
temp = y;
temp <<= 4;
- data[1] |= HIBYTE(temp);
- data[2] = LOBYTE(temp);
+ data[1] |= temp << 8;
+ data[2] = temp;
// Translate direction to eAthena format
switch (direction)