fix(Core/Units): Include charmed creatures in damagedByPlayer check (#25171)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Andrew 2026-04-04 00:09:27 -03:00 committed by GitHub
parent 4a49d525b5
commit b53011c5ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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