From 5affa03c7b67a8e87d9bafedd3da88554c9528d7 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Fri, 4 Mar 2022 21:46:30 -0500 Subject: [PATCH] Fix opensim longjump teleports --- indra/llmath/lloctree.h | 22 ---------------------- indra/newview/llviewermessage.cpp | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index 127d041b4a7..70e2f23ef90 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -402,28 +402,6 @@ class LLOctreeNode : public LLTreeNode<T> child->insert(data); } } - else if (parent) - { - //it's not in here, give it to the root - OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL; - - oct_node* node = this; - - while (parent) - { - node = parent; - parent = node->getOctParent(); - } - - node->insert(data); - } - else - { - // It's not in here, and we are root. - // LLOctreeRoot::insert() should have expanded - // root by now, something is wrong - OCT_ERRS << "Octree insertion failed! Root expansion failed." << LL_ENDL; - } return false; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6effc71229e..ef581fb3e43 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3382,6 +3382,22 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) gAgent.getRegion()->getOriginGlobal()); gAgent.setRegion(regionp); gObjectList.shiftObjects(shift_vector); + + // Is this a really long jump? + if (shift_vector.length() > 2048.f * 256.f) + { + regionp->reInitPartitions(); + gAgent.setRegion(regionp); + // Kill objects in the regions we left behind + for (LLViewerRegion* r : LLWorld::getInstance()->getRegionList()) + { + if (r != regionp) + { + gObjectList.killObjects(r); + } + } + } + gAssetStorage->setUpstream(msg->getSender()); gCacheName->setUpstream(msg->getSender()); gViewerThrottle.sendToSim(); -- GitLab