[Fix] Zone State Variables Load First (#4798)

This commit is contained in:
Chris Miles 2025-03-29 14:26:12 -05:00 committed by GitHub
parent 46511365a7
commit bb70850421
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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