Core/Units: Fixed bug in stun code making units summoned by npcs to never break out of stun

This commit is contained in:
hondacrx
2018-03-18 11:56:37 -04:00
parent 03d74be72a
commit 4d3d2290eb
+2 -2
View File
@@ -1149,8 +1149,8 @@ namespace Game.Entities
SetTarget(GetVictim().GetGUID());
// don't remove UNIT_FLAG_STUNNED for pet when owner is mounted (disabled pet's interface)
Unit owner = GetOwner();
if (owner == null || (owner.IsTypeId(TypeId.Player) && !owner.ToPlayer().IsMounted()))
Unit owner = GetCharmerOrOwner();
if (owner == null || !owner.IsTypeId(TypeId.Player) || !owner.ToPlayer().IsMounted())
RemoveFlag(UnitFields.Flags, UnitFlags.Stunned);
if (!HasUnitState(UnitState.Root)) // prevent moving if it also has root effect