diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/net/manaserv/beinghandler.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp index ac432e41..6193fed1 100644 --- a/src/net/manaserv/beinghandler.cpp +++ b/src/net/manaserv/beinghandler.cpp @@ -179,14 +179,14 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) { while (msg.getUnreadLength()) { - int id = msg.readInt16(); - int flags = msg.readInt8(); - Being *being = actorSpriteManager->findBeing(id); - int sx = 0, sy = 0, dx = 0, dy = 0, speed = 0; + const int id = msg.readInt16(); + const int flags = msg.readInt8(); - if ((!flags & (MOVING_POSITION | MOVING_DESTINATION))) + if (!(flags & (MOVING_POSITION | MOVING_DESTINATION))) continue; + int sx = 0, sy = 0, dx = 0, dy = 0, speed = 0; + if (flags & MOVING_POSITION) { sx = msg.readInt16(); @@ -200,6 +200,7 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) speed = msg.readInt8(); } + Being *being = actorSpriteManager->findBeing(id); if (!being) continue; |