From 25ae59b9ebf71d39d2ff5237b791f2599f4fa082 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 2 Oct 2013 16:57:02 -0700 Subject: varregion: remove scattered use of Constants.RegionSize by having routines reference RegionInfo.RegionWorldLoc?. --- OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 6 ++---- .../Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 4 ++-- OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | 4 ++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++-- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 ++----- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 4616170..7bc5e51 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -180,8 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat string message = c.Message; Scene scene = (Scene)c.Scene; Vector3 fromPos = c.Position; - Vector3 regionPos = new Vector3(scene.RegionInfo.LegacyRegionLocX * Constants.RegionSize, - scene.RegionInfo.LegacyRegionLocY * Constants.RegionSize, 0); + Vector3 regionPos = new Vector3(scene.RegionInfo.RegionWorldLocX, scene.RegionInfo.RegionWorldLocY, 0); if (c.Channel == DEBUG_CHANNEL) c.Type = ChatTypeEnum.DebugChannel; @@ -333,8 +332,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat { Vector3 fromRegionPos = fromPos + regionPos; Vector3 toRegionPos = presence.AbsolutePosition + - new Vector3(presence.Scene.RegionInfo.LegacyRegionLocX * Constants.RegionSize, - presence.Scene.RegionInfo.LegacyRegionLocY * Constants.RegionSize, 0); + new Vector3(presence.Scene.RegionInfo.RegionWorldLocX, presence.Scene.RegionInfo.RegionWorldLocY, 0); int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 7c60a40..a982466 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -663,8 +663,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles Vector3 avaPos = p.AbsolutePosition; // Getting the global position for the Avatar - Vector3 posGlobal = new Vector3(remoteClient.Scene.RegionInfo.LegacyRegionLocX*Constants.RegionSize + avaPos.X, - remoteClient.Scene.RegionInfo.LegacyRegionLocY*Constants.RegionSize + avaPos.Y, + Vector3 posGlobal = new Vector3(remoteClient.Scene.RegionInfo.RegionWorldLocX + avaPos.X, + remoteClient.Scene.RegionInfo.RegionWorldLocY + avaPos.Y, avaPos.Z); string landOwnerName = string.Empty; diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 769d662..bf87392 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs @@ -213,8 +213,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules if (part != null) { ObjectRegionName = s.RegionInfo.RegionName; - uint localX = (s.RegionInfo.LegacyRegionLocX * (int)Constants.RegionSize); - uint localY = (s.RegionInfo.LegacyRegionLocY * (int)Constants.RegionSize); + uint localX = s.RegionInfo.RegionWorldLocX; + uint localY = s.RegionInfo.RegionWorldLocY; ObjectRegionName = ObjectRegionName + " (" + localX + ", " + localY + ")"; return part; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7ef144c..297ee5f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2094,8 +2094,8 @@ namespace OpenSim.Region.Framework.Scenes // } // Get terrain height for sub-region in a megaregion if necessary - int X = (int)((m_scene.RegionInfo.LegacyRegionLocX * Constants.RegionSize) + pos.X); - int Y = (int)((m_scene.RegionInfo.LegacyRegionLocY * Constants.RegionSize) + pos.Y); + int X = (int)((m_scene.RegionInfo.RegionWorldLocX) + pos.X); + int Y = (int)((m_scene.RegionInfo.RegionWorldLocY) + pos.Y); GridRegion target_region = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, Y); // If X and Y is NaN, target_region will be null if (target_region == null) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c9c284f..2ac0805 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4241,10 +4241,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api DataserverPlugin.RegisterRequest(m_host.LocalId, m_item.ItemID, item.AssetID.ToString()); - Vector3 region = new Vector3( - World.RegionInfo.LegacyRegionLocX * Constants.RegionSize, - World.RegionInfo.LegacyRegionLocY * Constants.RegionSize, - 0); + Vector3 region = new Vector3(World.RegionInfo.RegionWorldLocX, World.RegionInfo.RegionWorldLocY, 0); World.AssetService.Get(item.AssetID.ToString(), this, delegate(string i, object sender, AssetBase a) @@ -5478,7 +5475,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetRegionCorner() { m_host.AddScriptLPS(1); - return new LSL_Vector(World.RegionInfo.LegacyRegionLocX * Constants.RegionSize, World.RegionInfo.LegacyRegionLocY * Constants.RegionSize, 0); + return new LSL_Vector(World.RegionInfo.RegionWorldLocX, World.RegionInfo.RegionWorldLocY, 0); } /// -- cgit v1.1