mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-06 17:08:23 +01:00
Scripts/Misc: added a few pointer checks in JustDied hook overrides
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user