fix(Core/Scripts): apply safety improvements (#24635)
This commit is contained in:
parent
4bda3ca1a9
commit
3b8ac391d9
6 changed files with 17 additions and 9 deletions
|
|
@ -238,7 +238,8 @@ struct npc_necropolis_health : public ScriptedAI
|
|||
if (spellInfo->Id == SPELL_DESPAWNER_OTHER && target->GetEntry() == NPC_NECROPOLIS)
|
||||
{
|
||||
DespawnNecropolis();
|
||||
dynamic_cast<Creature*>(target)->DespawnOrUnsummon();
|
||||
if (Creature* creature = target->ToCreature())
|
||||
creature->DespawnOrUnsummon();
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue