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:
parent
4a49d525b5
commit
b53011c5ef
1 changed files with 2 additions and 1 deletions
|
|
@ -1204,7 +1204,8 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
|
||||||
if (!attacker || attacker->IsControlledByPlayer() || attacker->IsCreatedByPlayer())
|
if (!attacker || attacker->IsControlledByPlayer() || attacker->IsCreatedByPlayer())
|
||||||
{
|
{
|
||||||
uint32 unDamage = health < damage ? health : damage;
|
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);
|
victim->ToCreature()->LowerPlayerDamageReq(unDamage, damagedByPlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue