fix(ElunaLuaEngine): Add nullptr checks to OnDamage and OnHeal methods (#320)

This commit is contained in:
Aldori
2025-09-25 19:24:38 -04:00
committed by GitHub
parent 058bc63ea4
commit 2dcacfe2b4

View File

@@ -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);