From 4ba4c9cf9e2002386fc157837f14cefe68fc7520 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 1 Aug 2016 04:48:01 +0100 Subject: missed a Math.sqrt ... --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fb35a54..e074af2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6394,7 +6394,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - if(dir.x == 0.0 && dir.y == 0.0) + if(dir.x == 0 && dir.y == 0) return 1; // SL wiki float rsx = World.RegionInfo.RegionSizeX; @@ -6409,9 +6409,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (dir.x == 0) { ex = px; - ey = dir.y > 0.0 ? rsy + 1.0f : -1.0f; + ey = dir.y > 0 ? rsy + 1.0f : -1.0f; } - else if(dir.y == 0.0f) + else if(dir.y == 0) { ex = dir.x > 0 ? rsx + 1.0f : -1.0f; ey = py; @@ -6422,6 +6422,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api float dy = (float) dir.y; float t1 = dx * dx + dy * dy; + t1 = (float)Math.Sqrt(t1); dx /= t1; dy /= t1; @@ -6430,7 +6431,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else t1 = -(px + 1f)/dx; - float t2; if(dy > 0) t2 = (rsy + 1f - py)/dy; -- cgit v1.1 From b1ef269dd3cc0557c37dc1f205fe8929ac49f4e9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 2 Aug 2016 01:15:53 +0100 Subject: add a extra null check on epxirecache out ( ?? ) --- OpenSim/Services/Connectors/Estate/EstateDataConnector.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs index 6412bcd..eed25cc 100644 --- a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs +++ b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs @@ -119,7 +119,7 @@ namespace OpenSim.Services.Connectors List eids = new List(); // If we don't have them, load them from the server List estates = null; - if (!m_EstateCache.TryGetValue("estates", out estates)) + if (!m_EstateCache.TryGetValue("estates", out estates) || estates == null) LoadEstateSettingsAll(); foreach (EstateSettings es in estates) @@ -132,7 +132,7 @@ namespace OpenSim.Services.Connectors { // If we don't have them, load them from the server List estates = null; - if (!m_EstateCache.TryGetValue("estates", out estates)) + if (!m_EstateCache.TryGetValue("estates", out estates) || estates == null) LoadEstateSettingsAll(); List eids = new List(); @@ -147,7 +147,7 @@ namespace OpenSim.Services.Connectors { // If we don't have them, load them from the server List estates = null; - if (!m_EstateCache.TryGetValue("estates", out estates)) + if (!m_EstateCache.TryGetValue("estates", out estates) || estates == null) LoadEstateSettingsAll(); List eids = new List(); -- cgit v1.1 From 908b5e852667cd8e7cef71dd83ed89db9aa50e0f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 2 Aug 2016 01:37:47 +0100 Subject: revert that and actually don't loose the estates :) --- OpenSim/Services/Connectors/Estate/EstateDataConnector.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs index eed25cc..74935f3 100644 --- a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs +++ b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs @@ -119,8 +119,8 @@ namespace OpenSim.Services.Connectors List eids = new List(); // If we don't have them, load them from the server List estates = null; - if (!m_EstateCache.TryGetValue("estates", out estates) || estates == null) - LoadEstateSettingsAll(); + if (!m_EstateCache.TryGetValue("estates", out estates)) + estates = LoadEstateSettingsAll(); foreach (EstateSettings es in estates) eids.Add((int)es.EstateID); @@ -132,8 +132,8 @@ namespace OpenSim.Services.Connectors { // If we don't have them, load them from the server List estates = null; - if (!m_EstateCache.TryGetValue("estates", out estates) || estates == null) - LoadEstateSettingsAll(); + if (!m_EstateCache.TryGetValue("estates", out estates)) + estates = LoadEstateSettingsAll(); List eids = new List(); foreach (EstateSettings es in estates) @@ -147,8 +147,8 @@ namespace OpenSim.Services.Connectors { // If we don't have them, load them from the server List estates = null; - if (!m_EstateCache.TryGetValue("estates", out estates) || estates == null) - LoadEstateSettingsAll(); + if (!m_EstateCache.TryGetValue("estates", out estates)) + estates = LoadEstateSettingsAll(); List eids = new List(); foreach (EstateSettings es in estates) -- cgit v1.1