From ee3d02bac66c12e6375af84d743a374a18fdc06d Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Tue, 5 Mar 2024 21:53:07 -0600 Subject: [PATCH] [Zoning] Zone routing adjustment (#4162) --- common/content/world_content_service.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/common/content/world_content_service.cpp b/common/content/world_content_service.cpp index c584d0644..95aa0b0b9 100644 --- a/common/content/world_content_service.cpp +++ b/common/content/world_content_service.cpp @@ -287,9 +287,14 @@ WorldContentService * WorldContentService::LoadZones() // era contextual routing, multiple version of zones, etc WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id, uint32 instance_id) { - // if we're already in a regular instance, we don't want to route the player to another instance - if (instance_id > RuleI(Instances, ReservedInstances)) { - return WorldContentService::FindZoneResult{}; + // if there's an active dynamic instance, we don't need to route + if (instance_id > 0) { + auto inst = InstanceListRepository::FindOne(*GetDatabase(), instance_id); + if (inst.id != 0 && !inst.is_global && !inst.never_expires) { + return WorldContentService::FindZoneResult{ + .zone_id = 0, + }; + } } for (auto &z: m_zones) { @@ -349,6 +354,6 @@ WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id } } - return WorldContentService::FindZoneResult{}; + return WorldContentService::FindZoneResult{.zone_id = 0}; }