[Zone] State Save Improvements (#4765)

* [Zone] State saving improvements

* Make sure we load spawn enabled off of the state row

* Update npc.h

* Update spawn2.cpp

* Update database_instances.cpp

* Update database_instances.cpp
This commit is contained in:
Chris Miles
2025-03-08 03:15:42 -06:00
committed by GitHub
parent 53610c2f0f
commit a8fea95eab
5 changed files with 59 additions and 10 deletions
+7 -1
View File
@@ -198,7 +198,13 @@ bool Spawn2::Process() {
}
//have the spawn group pick an NPC for us
uint32 npcid = currentnpcid && currentnpcid > 0 ? currentnpcid : spawn_group->GetNPCType(condition_value);
uint32 npcid = 0;
if (RuleB(Zone, StateSavingOnShutdown) && currentnpcid && currentnpcid > 0) {
npcid = currentnpcid;
} else {
npcid = spawn_group->GetNPCType(condition_value);
}
if (npcid == 0) {
LogSpawns("Spawn2 [{}]: Spawn group [{}] did not yeild an NPC! not spawning", spawn2_id, spawngroup_id_);