From c4d017af974ccb4769c50733afc8c8d82f236179 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 29 Jan 2024 14:36:06 +0100 Subject: Fixed logic error in ManaServ::BeingHandler --- src/net/manaserv/beinghandler.cpp | 11 ++++++----- 1 file 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; -- cgit v1.2.3-70-g09d2