fix(Core/Movement): Add safeguards against root freezes (#23117)

This commit is contained in:
killerwife
2025-10-05 19:45:07 +02:00
committed by GitHub
parent 2afcd037c7
commit 0767b2edf5
4 changed files with 17 additions and 9 deletions

View File

@@ -23,6 +23,7 @@
#include "Unit.h"
#include "Vehicle.h"
#include "WorldPacket.h"
#include "Log.h"
namespace Movement
{
@@ -103,7 +104,13 @@ namespace Movement
bool isOrientationOnly = args.path.size() == 2 && args.path[0] == args.path[1];
if ((moveFlags & MOVEMENTFLAG_ROOT) || isOrientationOnly)
if (moveFlags & MOVEMENTFLAG_ROOT) // This case should essentially never occur - hence the trace logging - hints to issues elsewhere
{
LOG_TRACE("movement", "Invalid movement during root. Entry: {} IsImmobilized {}, moveflags {}", unit->GetEntry(), unit->IsImmobilizedState() ? "true" : "false", moveFlags);
moveFlags &= ~MOVEMENTFLAG_MASK_MOVING;
}
if (isOrientationOnly)
moveFlags &= ~MOVEMENTFLAG_MASK_MOVING;
if (!args.HasVelocity)