mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
varregion: any conversions of use of Constants.RegionSize converted into
Util.cs routines to convert region coords to and from world coords or handles.
This commit is contained in:
@@ -518,7 +518,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
|
||||
public Vector3 StartPos
|
||||
{
|
||||
get { return new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 50); }
|
||||
get { return new Vector3(m_scene.RegionInfo.RegionSizeX * 0.5f, m_scene.RegionInfo.RegionSizeY * 0.5f, 50f); }
|
||||
set { }
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
|
||||
|
||||
// Local constants
|
||||
|
||||
// This computation is not the real region center if the region is larger than 256.
|
||||
// This computation isn't fixed because there is not a handle back to the region.
|
||||
private static readonly Vector3 CenterOfRegion = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 20);
|
||||
private static readonly char[] CS_SPACE = { ' ' };
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// This computation is not the real region center if the region is larger than 256.
|
||||
// This computation isn't fixed because there is not a handle back to the region.
|
||||
private static readonly OpenMetaverse.Vector3 CenterOfRegion = new OpenMetaverse.Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 20);
|
||||
private const int DEBUG_CHANNEL = 2147483647;
|
||||
|
||||
|
||||
@@ -122,8 +122,8 @@ namespace OpenSim.Region.OptionalModules
|
||||
|
||||
private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
|
||||
{
|
||||
if (newPoint.X < -1f || newPoint.X > (float)(Constants.RegionSize + 1) ||
|
||||
newPoint.Y < -1f || newPoint.Y > (float)(Constants.RegionSize + 1))
|
||||
if (newPoint.X < -1f || newPoint.X > (scene.RegionInfo.RegionSizeX + 1) ||
|
||||
newPoint.Y < -1f || newPoint.Y > (scene.RegionInfo.RegionSizeY) )
|
||||
return true;
|
||||
|
||||
SceneObjectPart obj = scene.GetSceneObjectPart(objectID);
|
||||
|
||||
@@ -170,7 +170,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
||||
c.Channel = m_channelNotify;
|
||||
c.Message += numScriptsFailed.ToString() + "," + message;
|
||||
c.Type = ChatTypeEnum.Region;
|
||||
c.Position = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30);
|
||||
if (m_scene != null)
|
||||
c.Position = new Vector3((m_scene.RegionInfo.RegionSizeX * 0.5f), (m_scene.RegionInfo.RegionSizeY * 0.5f), 30);
|
||||
else
|
||||
c.Position = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30);
|
||||
c.Sender = null;
|
||||
c.SenderUUID = UUID.Zero;
|
||||
c.Scene = m_scene;
|
||||
|
||||
@@ -748,8 +748,8 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
position.X = s_tree.AbsolutePosition.X + (float)randX;
|
||||
position.Y = s_tree.AbsolutePosition.Y + (float)randY;
|
||||
|
||||
if (position.X <= ((int)Constants.RegionSize - 1) && position.X >= 0 &&
|
||||
position.Y <= ((int)Constants.RegionSize - 1) && position.Y >= 0 &&
|
||||
if (position.X <= (m_scene.RegionInfo.RegionSizeX - 1) && position.X >= 0 &&
|
||||
position.Y <= (m_scene.RegionInfo.RegionSizeY - 1) && position.Y >= 0 &&
|
||||
Util.GetDistanceTo(position, copse.m_seed_point) <= copse.m_range)
|
||||
{
|
||||
UUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
Reference in New Issue
Block a user