varregion: remove scattered use of Constants.RegionSize by having routines reference RegionInfo.RegionWorldLoc?.

varregion
Robert Adams 2013-10-02 16:57:02 -07:00
parent 9b150194f6
commit 25ae59b9eb
5 changed files with 10 additions and 15 deletions

View File

@ -180,8 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
string message = c.Message; string message = c.Message;
Scene scene = (Scene)c.Scene; Scene scene = (Scene)c.Scene;
Vector3 fromPos = c.Position; Vector3 fromPos = c.Position;
Vector3 regionPos = new Vector3(scene.RegionInfo.LegacyRegionLocX * Constants.RegionSize, Vector3 regionPos = new Vector3(scene.RegionInfo.RegionWorldLocX, scene.RegionInfo.RegionWorldLocY, 0);
scene.RegionInfo.LegacyRegionLocY * Constants.RegionSize, 0);
if (c.Channel == DEBUG_CHANNEL) c.Type = ChatTypeEnum.DebugChannel; if (c.Channel == DEBUG_CHANNEL) c.Type = ChatTypeEnum.DebugChannel;
@ -333,8 +332,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
{ {
Vector3 fromRegionPos = fromPos + regionPos; Vector3 fromRegionPos = fromPos + regionPos;
Vector3 toRegionPos = presence.AbsolutePosition + Vector3 toRegionPos = presence.AbsolutePosition +
new Vector3(presence.Scene.RegionInfo.LegacyRegionLocX * Constants.RegionSize, new Vector3(presence.Scene.RegionInfo.RegionWorldLocX, presence.Scene.RegionInfo.RegionWorldLocY, 0);
presence.Scene.RegionInfo.LegacyRegionLocY * Constants.RegionSize, 0);
int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos);

View File

@ -663,8 +663,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
Vector3 avaPos = p.AbsolutePosition; Vector3 avaPos = p.AbsolutePosition;
// Getting the global position for the Avatar // Getting the global position for the Avatar
Vector3 posGlobal = new Vector3(remoteClient.Scene.RegionInfo.LegacyRegionLocX*Constants.RegionSize + avaPos.X, Vector3 posGlobal = new Vector3(remoteClient.Scene.RegionInfo.RegionWorldLocX + avaPos.X,
remoteClient.Scene.RegionInfo.LegacyRegionLocY*Constants.RegionSize + avaPos.Y, remoteClient.Scene.RegionInfo.RegionWorldLocY + avaPos.Y,
avaPos.Z); avaPos.Z);
string landOwnerName = string.Empty; string landOwnerName = string.Empty;

View File

@ -213,8 +213,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
if (part != null) if (part != null)
{ {
ObjectRegionName = s.RegionInfo.RegionName; ObjectRegionName = s.RegionInfo.RegionName;
uint localX = (s.RegionInfo.LegacyRegionLocX * (int)Constants.RegionSize); uint localX = s.RegionInfo.RegionWorldLocX;
uint localY = (s.RegionInfo.LegacyRegionLocY * (int)Constants.RegionSize); uint localY = s.RegionInfo.RegionWorldLocY;
ObjectRegionName = ObjectRegionName + " (" + localX + ", " + localY + ")"; ObjectRegionName = ObjectRegionName + " (" + localX + ", " + localY + ")";
return part; return part;
} }

View File

@ -2094,8 +2094,8 @@ namespace OpenSim.Region.Framework.Scenes
// } // }
// Get terrain height for sub-region in a megaregion if necessary // Get terrain height for sub-region in a megaregion if necessary
int X = (int)((m_scene.RegionInfo.LegacyRegionLocX * Constants.RegionSize) + pos.X); int X = (int)((m_scene.RegionInfo.RegionWorldLocX) + pos.X);
int Y = (int)((m_scene.RegionInfo.LegacyRegionLocY * Constants.RegionSize) + pos.Y); int Y = (int)((m_scene.RegionInfo.RegionWorldLocY) + pos.Y);
GridRegion target_region = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, 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 X and Y is NaN, target_region will be null
if (target_region == null) if (target_region == null)

View File

@ -4241,10 +4241,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
DataserverPlugin.RegisterRequest(m_host.LocalId, DataserverPlugin.RegisterRequest(m_host.LocalId,
m_item.ItemID, item.AssetID.ToString()); m_item.ItemID, item.AssetID.ToString());
Vector3 region = new Vector3( Vector3 region = new Vector3(World.RegionInfo.RegionWorldLocX, World.RegionInfo.RegionWorldLocY, 0);
World.RegionInfo.LegacyRegionLocX * Constants.RegionSize,
World.RegionInfo.LegacyRegionLocY * Constants.RegionSize,
0);
World.AssetService.Get(item.AssetID.ToString(), this, World.AssetService.Get(item.AssetID.ToString(), this,
delegate(string i, object sender, AssetBase a) delegate(string i, object sender, AssetBase a)
@ -5478,7 +5475,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Vector llGetRegionCorner() public LSL_Vector llGetRegionCorner()
{ {
m_host.AddScriptLPS(1); 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);
} }
/// <summary> /// <summary>