fix(Core/Players): Fixed awarding kill credit while being on vehicles. (#13944)

Fixes #12849
This commit is contained in:
UltraNix
2022-12-06 16:49:19 +01:00
committed by GitHub
parent 38a3774c63
commit 2dcf38a847

View File

@@ -1031,7 +1031,7 @@ 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->m_movedByPlayer != nullptr;
bool damagedByPlayer = unDamage && attacker && (attacker->IsPlayer() || attacker->m_movedByPlayer != nullptr);
victim->ToCreature()->LowerPlayerDamageReq(unDamage, damagedByPlayer);
}
}