fix(Core/Pets): Mob "soloed" by pet should not grant exp/loot to its … (#11969)

* fix(Core/Pets): Mob "soloed" by pet should not grant exp/loot to its master.

Fixes #11528
This commit is contained in:
UltraNix
2022-06-19 13:46:23 +02:00
committed by GitHub
parent 82cfd1b8d4
commit a935e51754
4 changed files with 45 additions and 16 deletions

View File

@@ -999,7 +999,11 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
victim->ToCreature()->SetLootRecipient(attacker);
if (!attacker || attacker->IsControlledByPlayer() || attacker->IsCreatedByPlayer())
victim->ToCreature()->LowerPlayerDamageReq(health < damage ? health : damage);
{
uint32 unDamage = health < damage ? health : damage;
bool damagedByPlayer = unDamage && attacker && attacker->m_movedByPlayer != nullptr;
victim->ToCreature()->LowerPlayerDamageReq(unDamage, damagedByPlayer);
}
}
if (health <= damage)