Scripts/Misc: added a few pointer checks in JustDied hook overrides

This commit is contained in:
Ovahlord committed 2022-09-12 09:15:10 +02:00
1 parent 64b9b1c28b
commit cecaedfb80
2 files changed
+2 -2

No files matched your search

@@ -362,7 +362,7 @@ struct npc_westfall_hobo_witness : public ScriptedAI
void JustDied(Unit* who) override
{
if (who->IsCreature() && who->ToCreature()->IsAIEnabled())
if (who && who->IsCreature() && who->ToCreature()->IsAIEnabled())
who->ToCreature()->AI()->DoAction(ACTION_AGGRO_HOBO_DONE);
me->CastSpell(me, SPELL_SUMMON_RAGAMUFFIN_LOOTER);
}
@@ -151,7 +151,7 @@ public:
void JustDied(Unit* killer) override
{
if (killer->GetEntry() == me->GetEntry())
if (killer && killer->GetEntry() == me->GetEntry())
return;
Talk(SAY_DEATH);