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

This commit is contained in:
xinef1 authored and Aokromes committed 2016-12-28 16:08:35 +01:00
1 parent 297fdc6e1a
commit 3d4a36a5bd
1 file changed
+2 -2
+2 -2
View File
@@ -14376,8 +14376,8 @@ void Unit::SetStunned(bool apply)
SetTarget(EnsureVictim()->GetGUID());
// don't remove UNIT_FLAG_STUNNED for pet when owner is mounted (disabled pet's interface)
Unit* owner = GetOwner();
if (!owner || (owner->GetTypeId() == TYPEID_PLAYER && !owner->ToPlayer()->IsMounted()))
Unit* owner = GetCharmerOrOwner();
if (!owner || owner->GetTypeId() != TYPEID_PLAYER || !owner->ToPlayer()->IsMounted())
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
if (!HasUnitState(UNIT_STATE_ROOT)) // prevent moving if it also has root effect