From bb708504217c72297ce2e106d3618e3b7860e766 Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Sat, 29 Mar 2025 14:26:12 -0500 Subject: [PATCH] [Fix] Zone State Variables Load First (#4798) --- zone/zone_save_state.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zone/zone_save_state.cpp b/zone/zone_save_state.cpp index fa4bd4e12..4e765fcac 100644 --- a/zone/zone_save_state.cpp +++ b/zone/zone_save_state.cpp @@ -365,7 +365,7 @@ inline void LoadNPCState(Zone *zone, NPC *n, ZoneStateSpawnsRepository::ZoneStat n->Depop(); } } - + n->SetPosition(s.x, s.y, s.z); n->SetHeading(s.heading); n->SetResumedFromZoneSuspend(true); @@ -453,12 +453,16 @@ bool Zone::LoadZoneState( zone->initgrids_timer.Trigger(); zone->Process(); + // load zone variables first for (auto &s: spawn_states) { if (s.is_zone) { LoadZoneVariables(zone, s.entity_variables); - continue; + break; } + } + // spawn2 + for (auto &s: spawn_states) { if (s.spawngroup_id == 0 || s.is_corpse || s.is_zone) { continue; }