[Zoning] Zone routing adjustment (#4162)

This commit is contained in:
Chris Miles 2024-03-05 21:53:07 -06:00 committed by GitHub
parent b90139bd9a
commit ee3d02bac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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};
}