mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Zoning] Fix zone routing edge case (#4255)
* [Zoning] Fix zone routing edge case * Push
This commit is contained in:
parent
2538ee7976
commit
ff3e955804
@ -357,3 +357,13 @@ WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id
|
|||||||
return WorldContentService::FindZoneResult{.zone_id = 0};
|
return WorldContentService::FindZoneResult{.zone_id = 0};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WorldContentService::IsInPublicStaticInstance(uint32 instance_id)
|
||||||
|
{
|
||||||
|
for (auto &i: m_zone_instances) {
|
||||||
|
if (i.id == instance_id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@ -178,6 +178,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
FindZoneResult FindZone(uint32 zone_id, uint32 instance_id);
|
FindZoneResult FindZone(uint32 zone_id, uint32 instance_id);
|
||||||
|
bool IsInPublicStaticInstance(uint32 instance_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int current_expansion{};
|
int current_expansion{};
|
||||||
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
||||||
|
|||||||
@ -755,11 +755,6 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
|
|||||||
pZoneName = strcpy(new char[zd->long_name.length() + 1], zd->long_name.c_str());
|
pZoneName = strcpy(new char[zd->long_name.length() + 1], zd->long_name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are zoning to the same zone, we need to use the current instance ID if it is not specified.
|
|
||||||
if (zoneID == zone->GetZoneID() && instance_id == 0) {
|
|
||||||
instance_id = zone->GetInstanceID();
|
|
||||||
}
|
|
||||||
|
|
||||||
auto r = content_service.FindZone(zoneID, instance_id);
|
auto r = content_service.FindZone(zoneID, instance_id);
|
||||||
if (r.zone_id) {
|
if (r.zone_id) {
|
||||||
zoneID = r.zone_id;
|
zoneID = r.zone_id;
|
||||||
@ -776,6 +771,11 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
|
|||||||
ignorerestrictions,
|
ignorerestrictions,
|
||||||
static_cast<int>(zm)
|
static_cast<int>(zm)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// If we are zoning to the same zone, we need to use the current instance ID if it is not specified.
|
||||||
|
if (content_service.IsInPublicStaticInstance(instance_id) && zoneID == zone->GetZoneID() && instance_id == 0) {
|
||||||
|
instance_id = zone->GetInstanceID();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user