[Bugfix] Prevent final shutdown from persisting incomplete state. (#4849)

* [Bugfix] Prevent final shutdown from persisting incomplete state.

* [Bugfix] Change shutdown parameters to member variable.
This commit is contained in:
zimp-wow
2025-04-09 20:55:56 -05:00
committed by GitHub
parent f9fe4ea2ec
commit dca892e258
4 changed files with 65 additions and 17 deletions
+4 -1
View File
@@ -887,7 +887,7 @@ void Zone::Shutdown(bool quiet)
c.second->WorldKick();
}
if (RuleB(Zone, StateSavingOnShutdown) && zone && zone->IsLoaded()) {
if (m_save_zone_state && RuleB(Zone, StateSavingOnShutdown) && zone && zone->IsLoaded()) {
SaveZoneState();
}
@@ -1010,6 +1010,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
SetIdleWhenEmpty(true);
SetSecondsBeforeIdle(60);
SetSaveZoneState(false);
if (database.GetServerType() == 1) {
pvpzone = true;
@@ -1204,6 +1205,8 @@ bool Zone::Init(bool is_static) {
}
content_db.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion());
SetSaveZoneState(true);
database.LoadCharacterCorpses(zoneid, instanceid);
content_db.LoadTraps(short_name, GetInstanceVersion());