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

(cherry picked from commit 7c3961244d)
This commit is contained in:
xinef1
2016-12-26 13:42:31 +01:00
committed by DoctorKraft
parent f44572ce56
commit 10af748969

View File

@@ -11219,8 +11219,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