From 282877a4542452031ccdeb3ac1aeed9431ae0311 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 14 Jul 2018 16:47:51 +0100 Subject: [PATCH] save a sqrt call --- OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 84bad25522..04605a2017 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -477,7 +477,7 @@ namespace OpenSim.Region.Framework.Scenes if (sp.ControllingClient.AgentId != remoteClient.AgentId) { if (!discardableEffects || - (discardableEffects && ShouldSendDiscardableEffect(remoteClient, sp))) + (discardableEffects && ShouldSendDiscardableEffect(remoteClient, sp))) { //m_log.DebugFormat("[YYY]: Sending to {0}", sp.UUID); sp.ControllingClient.SendViewerEffect(effectBlockArray); @@ -490,7 +490,7 @@ namespace OpenSim.Region.Framework.Scenes private bool ShouldSendDiscardableEffect(IClientAPI thisClient, ScenePresence other) { - return Vector3.Distance(other.CameraPosition, thisClient.SceneAgent.AbsolutePosition) < 10; + return Vector3.DistanceSquared(other.CameraPosition, thisClient.SceneAgent.AbsolutePosition) < 100; } private class DescendentsRequestData @@ -703,7 +703,7 @@ namespace OpenSim.Region.Framework.Scenes { InventoryFolderBase folder = new InventoryFolderBase(folderID, userID); - try + try { if (InventoryService.PurgeFolder(folder)) m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID);