From 7c363c904071099f009572c1b160247bfd4e9650 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Thu, 28 Oct 2021 06:23:29 -0300 Subject: [PATCH] fix(Core/Crashfix): Add nullptr checks for Blood Draining enchant (#8778) --- src/server/scripts/Spells/spell_item.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index f3e1bb491..ba5088350 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1310,8 +1310,10 @@ public: void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { PreventDefaultAction(); - if ((eventInfo.GetActionTarget()->GetHealth() - eventInfo.GetDamageInfo()->GetDamage()) >= eventInfo.GetActionTarget()->CountPctFromMaxHealth(35)) + if (!eventInfo.GetActionTarget() || !eventInfo.GetDamageInfo() || (eventInfo.GetActionTarget()->GetHealth() - eventInfo.GetDamageInfo()->GetDamage()) >= eventInfo.GetActionTarget()->CountPctFromMaxHealth(35)) + { return; + } const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(64569 /*SPELL_BLOOD_RESERVE*/); int32 basepoints = spellInfo->Effects[EFFECT_0].CalcValue() * this->GetStackAmount();