Core/Units: expand point movement checks for stop moving calls on roots and stuns from players to units

This commit is contained in:
Ovahlord
2017-12-30 23:41:24 +01:00
parent 5ac3aac028
commit e978aa8ad2

View File

@@ -11816,8 +11816,8 @@ void Unit::SetStunned(bool apply)
SetTarget(ObjectGuid::Empty);
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
// Stop movement if a player is affected by point motion master
if (GetTypeId() == TYPEID_PLAYER && GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
// Stop movement if unit is affected by point motion master
if (GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
StopMoving();
if (GetTypeId() == TYPEID_PLAYER)
@@ -11852,8 +11852,8 @@ void Unit::SetRooted(bool apply, bool packetOnly /*= false*/)
// setting MOVEMENTFLAG_ROOT
RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING);
AddUnitMovementFlag(MOVEMENTFLAG_ROOT);
// Stop movement if a player is currently affected by point motion master
if (GetTypeId() == TYPEID_PLAYER && GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
// Stop movement if unit is affected by point motion master
if (GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
StopMoving();
}
else