diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-30 14:09:50 +0300 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-30 14:09:50 +0300 |
commit | 198cd4df09d4d6aa9c5bbb6be9c4395d134f9f13 (patch) | |
tree | d4b87f39ab6353138594ca153ddadd5b217def00 /indra/newview/llagentui.cpp | |
parent | e161b128c7eac6df63b6d9210f3bca6c3cbc77ea (diff) | |
parent | c7053a6928fd5eafdc935453742e92951ae4e0c1 (diff) |
Merge branch 'main' into DRTVWR-567
# Conflicts:
# indra/newview/llinventoryfunctions.cpp
# indra/newview/llpanelmaininventory.h
# indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml
# indra/newview/skins/default/xui/en/sidepanel_item_info.xml
Diffstat (limited to 'indra/newview/llagentui.cpp')
-rw-r--r-- | indra/newview/llagentui.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 3410a37890..c19ad2ae6f 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -53,7 +53,16 @@ void LLAgentUI::buildSLURL(LLSLURL& slurl, const bool escaped /*= true*/) LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { - return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal()); + // Make sure coordinates are within current region + LLVector3d global_pos = gAgent.getPositionGlobal(); + LLVector3d region_origin = regionp->getOriginGlobal(); + // -1 otherwise slurl will fmod 256 to 0. + // And valid slurl range is supposed to be 0..255 + F64 max_val = REGION_WIDTH_METERS - 1; + global_pos.mdV[VX] = llclamp(global_pos[VX], region_origin[VX], region_origin[VX] + max_val); + global_pos.mdV[VY] = llclamp(global_pos[VY], region_origin[VY], region_origin[VY] + max_val); + + return_slurl = LLSLURL(regionp->getName(), global_pos); } slurl = return_slurl; } |