[Zone] Zone State Improvements Part 3 (#4773)

* [Zone State] Additional improvements

* Return early

* Update zone_save_state.cpp

* Push

* Push

* Update zone.cpp

* Update zone_save_state.cpp

* Equip items that were dynamically added on restore

* IsZoneStateValid helper

* ZoneStateSpawnsRepository::PurgeInvalidZoneStates

* Add Zone:StateSaveClearDays and PurgeOldZoneStates

* spawn2 / unique_spawn block when restored from zone state

* One time purge

* Update zone_state_spawns_repository.h

* Update npc.cpp

* Update npc.cpp

* test

* ORDER BY spawn2_id

* Stuff

* Restored corpses shouldn't trigger events

* Fix weird edge case
This commit is contained in:
Chris Miles
2025-03-13 17:00:30 -05:00
committed by GitHub
parent f6b18fb003
commit 8d1a9efac9
14 changed files with 235 additions and 48 deletions
+6 -1
View File
@@ -23,6 +23,11 @@ void NPC::AddLootTable(uint32 loottable_id, bool is_global)
return;
}
if (m_resumed_from_zone_suspend) {
LogZoneState("NPC [{}] is resuming from zone suspend, skipping", GetCleanName());
return;
}
if (!is_global) {
m_loot_copper = 0;
m_loot_silver = 0;
@@ -277,7 +282,7 @@ void NPC::AddLootDrop(
)
{
if (m_resumed_from_zone_suspend) {
LogZoneState("NPC [{}] is resuming from zone suspend, skipping AddItem", GetCleanName());
LogZoneState("NPC [{}] is resuming from zone suspend, skipping", GetCleanName());
return;
}