Core/Unit: Pet shouldn't be notified for DOT damage on the owner (#17133)

- Fix by @MrSmite
- Closes #16894
(cherry picked from commit 4de1426d08)
This commit is contained in:
mik1893
2016-05-15 10:26:27 +01:00
committed by joschiwald
parent ae11329e71
commit 4c60bbea0e

View File

@@ -623,11 +623,14 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
if (victim->GetTypeId() == TYPEID_PLAYER && this != victim)
{
// Signal to pets that their owner was attacked
Pet* pet = victim->ToPlayer()->GetPet();
// Signal to pets that their owner was attacked - except when DOT.
if (damagetype != DOT)
{
Pet* pet = victim->ToPlayer()->GetPet();
if (pet && pet->IsAlive())
pet->AI()->OwnerAttackedBy(this);
if (pet && pet->IsAlive())
pet->AI()->OwnerAttackedBy(this);
}
if (victim->ToPlayer()->GetCommandStatus(CHEAT_GOD))
return 0;