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
|
|
@ -28,7 +28,7 @@
|
|||
template<class T>
|
||||
void PointMovementGenerator<T>::DoInitialize(T* unit)
|
||||
{
|
||||
if (unit->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
if (unit->HasUnitState(UNIT_STATE_NOT_MOVE) || unit->IsMovementPreventedByCasting())
|
||||
{
|
||||
// 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.
|
||||
|
|
@ -98,9 +98,9 @@ bool PointMovementGenerator<T>::DoUpdate(T* unit, uint32 /*diff*/)
|
|||
if (!unit)
|
||||
return false;
|
||||
|
||||
if (unit->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
|
||||
if (unit->HasUnitState(UNIT_STATE_NOT_MOVE) || unit->IsMovementPreventedByCasting())
|
||||
{
|
||||
unit->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
unit->StopMoving();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue