From 2dcacfe2b4352ef7fef22c946b209af5c6252371 Mon Sep 17 00:00:00 2001 From: Aldori Date: Thu, 25 Sep 2025 19:24:38 -0400 Subject: [PATCH] fix(ElunaLuaEngine): Add nullptr checks to OnDamage and OnHeal methods (#320) --- src/ElunaLuaEngine_SC.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ElunaLuaEngine_SC.cpp b/src/ElunaLuaEngine_SC.cpp index 78a2539..9b45732 100644 --- a/src/ElunaLuaEngine_SC.cpp +++ b/src/ElunaLuaEngine_SC.cpp @@ -1219,6 +1219,9 @@ public: void OnHeal(Unit* healer, Unit* receiver, uint32& gain) override { + if (!receiver) return; + if (!healer) return; + if (healer->IsPlayer()) sEluna->OnPlayerHeal(healer->ToPlayer(), receiver, gain); @@ -1228,6 +1231,9 @@ public: void OnDamage(Unit* attacker, Unit* receiver, uint32& damage) override { + if (!receiver) return; + if (!attacker) return; + if (attacker->IsPlayer()) sEluna->OnPlayerDamage(attacker->ToPlayer(), receiver, damage);