fix(Core/Spells): Charging unit should always reach its target even if stunned/rooted. (#10192)

Fixes #9454
This commit is contained in:
UltraNix
2022-01-16 18:58:34 +01:00
committed by GitHub
parent e1cb6b4b68
commit d3956f3142

View File

@@ -99,12 +99,22 @@ bool PointMovementGenerator<T>::DoUpdate(T* unit, uint32 /*diff*/)
if (!unit)
return false;
if (unit->HasUnitState(UNIT_STATE_NOT_MOVE) || unit->IsMovementPreventedByCasting())
if (unit->IsMovementPreventedByCasting())
{
unit->StopMoving();
return true;
}
if (unit->HasUnitState(UNIT_STATE_NOT_MOVE))
{
if (!unit->HasUnitState(UNIT_STATE_CHARGING))
{
unit->StopMoving();
}
return true;
}
unit->AddUnitState(UNIT_STATE_ROAMING_MOVE);
if (i_recalculateSpeed && !unit->movespline->Finalized())