diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-29 14:36:06 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-29 14:36:06 +0100 |
commit | c4d017af974ccb4769c50733afc8c8d82f236179 (patch) | |
tree | a781b93afcced8b21e9ca91d3e309af58c263a51 /src/net/manaserv | |
parent | 32a027a3fdfcd7642e41530813e8401bc99baf54 (diff) | |
download | mana-c4d017af974ccb4769c50733afc8c8d82f236179.tar.gz mana-c4d017af974ccb4769c50733afc8c8d82f236179.tar.bz2 mana-c4d017af974ccb4769c50733afc8c8d82f236179.tar.xz mana-c4d017af974ccb4769c50733afc8c8d82f236179.zip |
Fixed logic error in ManaServ::BeingHandler
Diffstat (limited to 'src/net/manaserv')
-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; |