Core/SAI: SMART_ACTION_PAUSE_MOVEMENT

Closes #22346

(cherry picked from commit 6f31784979)
This commit is contained in:
Ovahlord
2020-02-18 22:52:35 +01:00
committed by Shauren
parent 94034e1565
commit a90b9abbf0
3 changed files with 16 additions and 14 deletions

View File

@@ -2354,18 +2354,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
target->ToUnit()->RemoveAllGameObjects();
break;
}
case SMART_ACTION_REMOVE_MOVEMENT:
case SMART_ACTION_PAUSE_MOVEMENT:
{
for (WorldObject* const target : targets)
{
if (IsUnit(target))
{
if (e.action.removeMovement.movementType && e.action.removeMovement.movementType < MAX_MOTION_TYPE)
target->ToUnit()->GetMotionMaster()->Remove(MovementGeneratorType(e.action.removeMovement.movementType));
if (e.action.removeMovement.forced)
target->ToUnit()->StopMoving();
}
}
target->ToUnit()->PauseMovement(e.action.pauseMovement.pauseTimer, e.action.pauseMovement.movementSlot, e.action.pauseMovement.force);
break;
}
case SMART_ACTION_RESPAWN_BY_SPAWNID: