fix: Crash on ProcessDelayedDamages (#16166)

This commit is contained in:
Angelo Venturini
2023-05-03 06:27:44 -03:00
committed by GitHub
parent eea71a415e
commit 3dbdea5e28
2 changed files with 6 additions and 1 deletions

View File

@@ -814,7 +814,7 @@ void Unit::DealDamageMods(Unit const* victim, uint32& damage, uint32* absorb)
uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellInfo const* spellProto, bool durabilityLoss, bool /*allowGM*/, Spell const* damageSpell /*= nullptr*/, bool delayed)
{
if (delayed && attacker->GetTypeId() == TYPEID_PLAYER && attacker->GetGUID() != victim->GetGUID())
if (delayed && attacker && attacker->GetTypeId() == TYPEID_PLAYER && attacker->GetGUID() != victim->GetGUID())
{
sWorld->AddDelayedDamage(attacker, victim, damage, cleanDamage, damagetype, damageSchoolMask, spellProto, durabilityLoss);
return 0;