From d093f4ea1f2b57efda664e4be86d6f354411049d Mon Sep 17 00:00:00 2001 From: insunaa Date: Thu, 22 Feb 2024 16:56:10 +0100 Subject: [PATCH] Unit: Add nullptr check for caster --- src/game/Entities/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/Entities/Unit.cpp b/src/game/Entities/Unit.cpp index 37ed4ca5438..44770c49ef6 100644 --- a/src/game/Entities/Unit.cpp +++ b/src/game/Entities/Unit.cpp @@ -8076,7 +8076,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellSchoolMask schoolMask, Spe AuraList const& mOwnerTaken = GetAurasByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); for (auto i : mOwnerTaken) { - if (i->GetCasterGuid() == caster->GetObjectGuid() && i->isAffectedOnSpell(spellInfo)) + if (caster && i->GetCasterGuid() == caster->GetObjectGuid() && i->isAffectedOnSpell(spellInfo)) TakenTotalMod *= (i->GetModifier()->m_amount + 100.0f) / 100.0f; }