fix(Core/Unit): Add leash extension with damage dealt. (#19880)

Init.
This commit is contained in:
Benjamin Jackson
2024-09-06 16:02:53 -04:00
committed by GitHub
parent 6e5cd04591
commit 632d7f5f9e

View File

@@ -1041,6 +1041,10 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage
if (!victim->IsPlayer())
{
/// @fix: Hack to avoid premature leashing
if (damagetype != DOT && damage > 0 && !victim->GetOwnerGUID().IsPlayer() && (!spellProto || !spellProto->HasAura(SPELL_AURA_DAMAGE_SHIELD)))
victim->ToCreature()->UpdateLeashExtensionTime();
if (attacker)
{
if (spellProto && victim->CanHaveThreatList() && !victim->HasUnitState(UNIT_STATE_EVADE) && !victim->IsInCombatWith(attacker))