From 2e575652f607a6a7b7ef1875be156d32d5df1ab8 Mon Sep 17 00:00:00 2001 From: Natedog2012 Date: Tue, 31 Jan 2023 16:32:25 -0600 Subject: [PATCH] =?UTF-8?q?[Bug=20fix]#reload=20static=20should=20now=20pr?= =?UTF-8?q?operly=20fill=20the=20entity=5Flists=20for=E2=80=A6=20(#2815)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Bug fix]#reload static should now properly fill the entity_lists for objects / doors / groundspawns The individual #reload commands WILL still have issues when trying to use #list afterwards! * Point ReloadDoors, ReloadGroundSpawns, ReloadObjects all to reload static to avoid entity_list data missing --- zone/worldserver.cpp | 30 +++--------------------------- zone/zone.cpp | 4 ++-- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 3fd25b135..13e824cf5 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -1939,16 +1939,6 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) content_service.SetExpansionContext()->ReloadContentFlags(); break; } - case ServerOP_ReloadDoors: - { - if (zone && zone->IsLoaded()) { - zone->SendReloadMessage("Doors"); - entity_list.RemoveAllDoors(); - zone->LoadZoneDoors(); - entity_list.RespawnAllDoors(); - } - break; - } case ServerOP_ReloadDzTemplates: { if (zone) @@ -1958,14 +1948,6 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) } break; } - case ServerOP_ReloadGroundSpawns: - { - if (zone && zone->IsLoaded()) { - zone->SendReloadMessage("Ground Spawns"); - zone->LoadGroundSpawns(); - } - break; - } case ServerOP_ReloadLevelEXPMods: { if (zone && zone->IsLoaded()) { @@ -1995,15 +1977,6 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) } break; } - case ServerOP_ReloadObjects: - { - if (zone && zone->IsLoaded()) { - zone->SendReloadMessage("Objects"); - entity_list.RemoveAllObjects(); - zone->LoadZoneObjects(); - } - break; - } case ServerOP_ReloadPerlExportSettings: { zone->SendReloadMessage("Perl Event Export Settings"); @@ -2016,6 +1989,9 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) RuleManager::Instance()->LoadRules(&database, RuleManager::Instance()->GetActiveRuleset(), true); break; } + case ServerOP_ReloadDoors: + case ServerOP_ReloadGroundSpawns: + case ServerOP_ReloadObjects: case ServerOP_ReloadStaticZoneData: { if (zone && zone->IsLoaded()) { zone->SendReloadMessage("Static Zone Data"); diff --git a/zone/zone.cpp b/zone/zone.cpp index 0cc99481c..1d4f61a81 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -1231,6 +1231,8 @@ bool Zone::Init(bool is_static) { void Zone::ReloadStaticData() { LogInfo("Reloading Zone Static Data"); + entity_list.RemoveAllObjects(); //Ground spawns are also objects we clear list then fill it + entity_list.RemoveAllDoors(); //Some objects are also doors so clear list before filling if (!content_db.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { LogError("Loading static zone points failed"); @@ -1249,14 +1251,12 @@ void Zone::ReloadStaticData() { LogError("Reloading ground spawns failed. continuing"); } - entity_list.RemoveAllObjects(); LogInfo("Reloading World Objects from DB"); if (!LoadZoneObjects()) { LogError("Reloading World Objects failed. continuing"); } - entity_list.RemoveAllDoors(); LoadZoneDoors(); entity_list.RespawnAllDoors();