mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 08:26:36 +00:00
[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:
@@ -208,6 +208,15 @@ void QuestManager::write(const char *file, const char *str) {
|
||||
}
|
||||
|
||||
Mob* QuestManager::spawn2(int npc_id, int grid, int unused, const glm::vec4& position) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (owner && owner->IsNPC()) {
|
||||
auto n = owner->CastToNPC();
|
||||
if (n->IsResumedFromZoneSuspend()) {
|
||||
LogZoneState("NPC [{}] is resuming from zone suspend, skipping quest call", n->GetCleanName());
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const NPCType* t = 0;
|
||||
if (t = content_db.LoadNPCTypesData(npc_id)) {
|
||||
auto npc = new NPC(t, nullptr, position, GravityBehavior::Water);
|
||||
@@ -228,6 +237,15 @@ Mob* QuestManager::spawn2(int npc_id, int grid, int unused, const glm::vec4& pos
|
||||
}
|
||||
|
||||
Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, const glm::vec4& position) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (owner && owner->IsNPC()) {
|
||||
auto n = owner->CastToNPC();
|
||||
if (n->IsResumedFromZoneSuspend()) {
|
||||
LogZoneState("NPC [{}] is resuming from zone suspend, skipping quest call", n->GetCleanName());
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Mob *other = entity_list.GetMobByNpcTypeID(npc_type);
|
||||
if(other != nullptr) {
|
||||
return other;
|
||||
|
||||
Reference in New Issue
Block a user