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

This commit is contained in:
Ovahlord
2022-05-08 20:36:50 +02:00
parent 64b9b1c28b
commit cecaedfb80
2 changed files with 2 additions and 2 deletions

View File

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

View File

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