fix(Core/Scripts): apply safety improvements (#24635)

This commit is contained in:
Francesco Borzì
2026-02-07 21:22:58 +01:00
committed by GitHub
parent 4bda3ca1a9
commit 3b8ac391d9
6 changed files with 17 additions and 9 deletions

View File

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