From 33a375677e69e6aac17c726ac6fb96130e5c1bfc Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Fri, 4 Aug 2023 13:05:33 -0500 Subject: [PATCH] [Fix] Fix issue with mob scanning when trying to use EVENT_SPAWN (#3529) --- zone/entity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 94582eb79..a4339627f 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -674,6 +674,8 @@ void EntityList::AddNPC(NPC *npc, bool send_spawn_packet, bool dont_queue) npc_list.emplace(std::pair(npc->GetID(), npc)); mob_list.emplace(std::pair(npc->GetID(), npc)); + entity_list.ScanCloseMobs(npc->close_mobs, npc, true); + if (parse->HasQuestSub(npc->GetNPCTypeID(), EVENT_SPAWN)) { parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0); } @@ -713,8 +715,6 @@ void EntityList::AddNPC(NPC *npc, bool send_spawn_packet, bool dont_queue) npc->SendPositionToClients(); - entity_list.ScanCloseMobs(npc->close_mobs, npc, true); - if (parse->HasQuestSub(ZONE_CONTROLLER_NPC_ID, EVENT_SPAWN_ZONE)) { npc->DispatchZoneControllerEvent(EVENT_SPAWN_ZONE, npc, "", 0, nullptr); }