fix(Core/Movement): Fix strange teleport when rooting a fleeing NPC (#5555)

This commit is contained in:
Chaouki Dhib
2021-05-08 15:22:18 +02:00
committed by GitHub
parent 3c763786a0
commit a203a5183b

View File

@@ -17,6 +17,14 @@
template<class T>
void PointMovementGenerator<T>::DoInitialize(T* unit)
{
if (unit->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
{
// the next line is to ensure that a new spline is created in DoUpdate() once the unit is no longer rooted/stunned
// todo: rename this flag to something more appropriate since it is set to true even without speed change now.
i_recalculateSpeed = true;
return;
}
if (!unit->IsStopped())
unit->StopMoving();