summaryrefslogtreecommitdiff
path: root/src/net/beinghandler.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-09-02 11:58:35 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-09-02 11:58:35 +0000
commit2b322bf18d80acb464a9dc1820e581e7204cca1e (patch)
tree6938f1d8f63c8d8c1142b972117b42d2c50d1883 /src/net/beinghandler.cpp
parentda43e09d2b043d5c75ad0adb87dd43f1fe36fe8f (diff)
downloadmana-2b322bf18d80acb464a9dc1820e581e7204cca1e.tar.gz
mana-2b322bf18d80acb464a9dc1820e581e7204cca1e.tar.bz2
mana-2b322bf18d80acb464a9dc1820e581e7204cca1e.tar.xz
mana-2b322bf18d80acb464a9dc1820e581e7204cca1e.zip
Switched to short IDs for beings.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r--src/net/beinghandler.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index e3eb6eba..8ccd3dd6 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -398,7 +398,7 @@ void
BeingHandler::handleBeingEnterMessage(MessageIn &msg)
{
int type = msg.readByte(); // type
- int id = msg.readLong();
+ int id = msg.readShort();
switch (type) {
case OBJECT_PLAYER:
@@ -431,8 +431,7 @@ BeingHandler::handleBeingEnterMessage(MessageIn &msg)
void BeingHandler::handleBeingLeaveMessage(MessageIn &msg)
{
- msg.readByte(); // type, assume player for now, TODO
- Being *being = beingManager->findBeing(msg.readLong());
+ Being *being = beingManager->findBeing(msg.readShort());
if (!being) return;
if (being == player_node->getTarget())
{
@@ -443,9 +442,9 @@ void BeingHandler::handleBeingLeaveMessage(MessageIn &msg)
void BeingHandler::handleBeingsMoveMessage(MessageIn &msg)
{
- for (int nb = (msg.getLength() - 2) / (4 + 4 * 2); nb > 0; --nb)
+ for (int nb = (msg.getLength() - 2) / (2 + 4 * 2); nb > 0; --nb)
{
- Uint32 id = msg.readLong();
+ Uint16 id = msg.readShort();
Being *being = beingManager->findBeing(id);
if (!being) continue;
int sx = msg.readShort(), sy = msg.readShort(),