From c2e63e807e4b0204f63e3db6f929acb18845bf5e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 12 Jun 2016 14:48:30 -0700 Subject: [PATCH] Mantis #7861. llEdgeOfWorld not working. Two reasons: (1) edge was being filled but not used; (2) region size was being ignored when computing the neighbors' coordinates. Not sure if this is the intended semantics of this function, but it made sense in my varregion test with neighbors all around except in the South. --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ad444ebe31..fac361fa61 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6409,7 +6409,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { // Y is the only valid direction - edge.y = dir.y / Math.Abs(dir.y); + edge.y = dir.y / Math.Abs(dir.y) * (World.RegionInfo.RegionSizeY / Constants.RegionSize); } } else @@ -6431,20 +6431,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (edge.y > World.RegionInfo.RegionSizeY || edge.y < 0) { // Y goes out of bounds first - edge.y = dir.y / Math.Abs(dir.y); + edge.y = dir.y / Math.Abs(dir.y) * (World.RegionInfo.RegionSizeY / Constants.RegionSize); } else { // X goes out of bounds first or its a corner exit edge.y = 0; - edge.x = dir.x / Math.Abs(dir.x); + edge.x = dir.x / Math.Abs(dir.x) * (World.RegionInfo.RegionSizeY / Constants.RegionSize); } } List neighbors = World.GridService.GetNeighbours(World.RegionInfo.ScopeID, World.RegionInfo.RegionID); - uint neighborX = World.RegionInfo.RegionLocX + (uint)dir.x; - uint neighborY = World.RegionInfo.RegionLocY + (uint)dir.y; + uint neighborX = World.RegionInfo.RegionLocX + (uint)edge.x; + uint neighborY = World.RegionInfo.RegionLocY + (uint)edge.y; foreach (GridRegion sri in neighbors) {