Temporarily allow neighbouring regions to load during crossings when neighbour connections are disabled

When debug setting to disable neighbouring regions is enabled, the viewer now makes an exception and function pauses itself while the avatar is physically out of bounds of the current region (negative pos, or pos bigger than max region size) indicating a possible region crossing (or grid error). This allows neighbouring regions to load during manual region crossings instead of leaving the user flying into the void.
The option still prevents neighbour connections under normal circumstances as intended. However, with this adjustment, region crossings are at least partially possible in most cases, though still not as seamless as with full neighbour connections enabled.
master
PanteraPolnocy 2025-09-10 12:57:09 +02:00
parent 71ece236ea
commit 5512a49a4d
1 changed files with 10 additions and 2 deletions

View File

@ -1599,11 +1599,19 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data)
if (fsDisableNeighbourRegionConnections)
{
LLViewerRegion* current_region = gAgent.getRegion();
if (current_region && current_region->getHandle() != handle)
if (current_region)
{
F32 regionSize = current_region->getWidth();
LLVector3 avPos = gAgent.getPositionAgent();
if (avPos.mV[VX] >= 0 && avPos.mV[VX] <= regionSize && avPos.mV[VY] >= 0 && avPos.mV[VY] <= regionSize)
{
if (current_region->getHandle() != handle)
{
return;
}
}
}
}
// </FS:PP>
// which simulator should we modify?