summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2025-09-22 15:46:04 +0300
committerGitHub <noreply@github.com>2025-09-22 15:46:04 +0300
commitd7bd769129100332791569cbffa07f54d2fca991 (patch)
treee6c70f27363fe436c7376c2440b76452d4787aa5 /indra/newview/llviewerobject.cpp
parent569d7c6a8b1e44b66dad16a3367547cdf3395620 (diff)
#4715 disable ZoomIn an object item when the region is not connected to the current region
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 9e77b40a45..ce93e6f371 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -7717,6 +7717,51 @@ void LLViewerObject::clearTEWaterExclusion(const U8 te)
}
}
+bool LLViewerObject::isReachable()
+{
+ LLViewerRegion* agent_region = gAgent.getRegion();
+ LLViewerRegion* object_region = getRegion();
+
+ if (!agent_region || !object_region)
+ {
+ return false;
+ }
+ if (agent_region == object_region)
+ {
+ return true;
+ }
+
+ std::unordered_set<LLViewerRegion*> visited;
+ std::queue<LLViewerRegion*> pending;
+ visited.insert(agent_region);
+ pending.push(agent_region);
+
+ while (!pending.empty())
+ {
+ LLViewerRegion* current = pending.front();
+ pending.pop();
+
+ std::vector<LLViewerRegion*> neighbors;
+ current->getNeighboringRegions(neighbors);
+
+ for (LLViewerRegion* neighbor : neighbors)
+ {
+ if (!neighbor) continue;
+
+ if (neighbor == object_region)
+ {
+ return true;
+ }
+ // region's neighbors were not checked
+ if (visited.insert(neighbor).second)
+ {
+ pending.push(neighbor);
+ }
+ }
+ }
+ return false;
+}
+
class ObjectPhysicsProperties : public LLHTTPNode
{
public: