Core/Movement: use helpers for validation

Port From (https://github.com/TrinityCore/TrinityCore/commit/0b6049fe0bf49a8c21114960cb7a6522f48c8308)
This commit is contained in:
hondacrx
2021-09-26 13:49:13 -04:00
parent 53ad19d2f9
commit cf79d69487
3 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -169,7 +169,7 @@ namespace Game.Entities
public void PauseMovement(uint timer = 0, MovementSlot slot = 0, bool forced = true)
{
if (slot >= MovementSlot.Max)
if (MotionMaster.IsInvalidMovementSlot(slot))
return;
IMovementGenerator movementGenerator = GetMotionMaster().GetMotionSlot(slot);
@@ -182,7 +182,7 @@ namespace Game.Entities
public void ResumeMovement(uint timer = 0, MovementSlot slot = 0)
{
if (slot >= MovementSlot.Max)
if (MotionMaster.IsInvalidMovementSlot(slot))
return;
IMovementGenerator movementGenerator = GetMotionMaster().GetMotionSlot(slot);