fix(Core/Movement): Fix strange teleport when rooting a fleeing NPC (#5555)
This commit is contained in:
@@ -17,6 +17,14 @@
|
|||||||
template<class T>
|
template<class T>
|
||||||
void PointMovementGenerator<T>::DoInitialize(T* unit)
|
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())
|
if (!unit->IsStopped())
|
||||||
unit->StopMoving();
|
unit->StopMoving();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user