diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index bd866f72..29525332 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -1027,6 +1027,20 @@ void MovementAction::UpdateMovementState() bot->SendMovementFlagUpdate(); } + // See if the bot is currently slowed, rooted, or otherwise unable to move + bool isCurrentlyRestricted = bot->isFrozen() || bot->IsPolymorphed() || bot->HasRootAura() || bot->HasStunAura() || + bot->HasConfuseAura() || bot->HasUnitState(UNIT_STATE_LOST_CONTROL); + + // Detect if movement restrictions have been lifted + if (wasMovementRestricted && !isCurrentlyRestricted && bot->IsAlive()) + { + // CC just ended - refresh movement state to ensure animations play correctly + bot->SendMovementFlagUpdate(); + } + + // Save current state for the next check + wasMovementRestricted = isCurrentlyRestricted; + // Temporary speed increase in group // if (botAI->HasRealPlayerMaster()) { // bot->SetSpeedRate(MOVE_RUN, 1.1f); diff --git a/src/strategy/actions/MovementActions.h b/src/strategy/actions/MovementActions.h index ad9c91bc..c647027a 100644 --- a/src/strategy/actions/MovementActions.h +++ b/src/strategy/actions/MovementActions.h @@ -73,6 +73,7 @@ private: // normal_only = false, float step = 8.0f); const Movement::PointsArray SearchForBestPath(float x, float y, float z, float& modified_z, int maxSearchCount = 5, bool normal_only = false, float step = 8.0f); + bool wasMovementRestricted = false; }; class FleeAction : public MovementAction