fix(Core/Movement): creatures should not cast while moving (#9141)
- Closes #8843
This commit is contained in:
parent
006ee3b7e2
commit
70fbaefa8e
10 changed files with 53 additions and 52 deletions
|
|
@ -33,8 +33,10 @@ void FleeingMovementGenerator<T>::_setTargetLocation(T* owner)
|
|||
if (!owner)
|
||||
return;
|
||||
|
||||
if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_setMoveData(owner))
|
||||
return;
|
||||
|
|
@ -346,9 +348,9 @@ bool FleeingMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
|||
if (!owner || !owner->IsAlive())
|
||||
return false;
|
||||
|
||||
if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
|
||||
{
|
||||
owner->ClearUnitState(UNIT_STATE_FLEEING_MOVE);
|
||||
owner->StopMoving();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -385,9 +387,9 @@ bool TimedFleeingMovementGenerator::Update(Unit* owner, uint32 time_diff)
|
|||
if (!owner->IsAlive())
|
||||
return false;
|
||||
|
||||
if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
|
||||
{
|
||||
owner->ClearUnitState(UNIT_STATE_FLEEING_MOVE);
|
||||
owner->StopMoving();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue