From 4ba4c9cf9e2002386fc157837f14cefe68fc7520 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 1 Aug 2016 04:48:01 +0100 Subject: [PATCH] missed a Math.sqrt ... --- .../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 fb35a54e76..e074af2985 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;