Re initiate spatial partitions in the main region after a long teleport jump.

Also kill objects in the regions we left behind.
Restore max octree range to 1024 * 1024
This commit is contained in:
Latif Khalifa
2013-09-12 09:42:55 +02:00
parent 5b73586b95
commit c14d46074c
4 changed files with 28 additions and 1 deletions

View File

@@ -4563,6 +4563,21 @@ 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 (LLWorld::region_list_t::const_iterator r = LLWorld::getInstance()->getRegionList().begin();
r != LLWorld::getInstance()->getRegionList().end(); ++r)
{
if (*r != regionp)
{
gObjectList.killObjects(*r);
}
}
}
gAssetStorage->setUpstream(msg->getSender());
gCacheName->setUpstream(msg->getSender());
gViewerThrottle.sendToSim();