Mantis #7765: Add new ClampNegativeZ option. Defaults to false to restore prior functionality.

Avination code wasn't designed for deep building.
LSLKeyTest
Melanie Thielker 2015-11-26 17:29:50 +01:00
parent 172bb05ec2
commit 9afe2b018f
3 changed files with 16 additions and 2 deletions

View File

@ -174,6 +174,13 @@ namespace OpenSim.Region.Framework.Scenes
public SynchronizeSceneHandler SynchronizeScene;
public bool ClampNegativeZ
{
get { return m_clampNegativeZ; }
}
private bool m_clampNegativeZ = false;
/// <summary>
/// Used to prevent simultaneous calls to code that adds and removes agents.
/// </summary>
@ -1029,6 +1036,8 @@ namespace OpenSim.Region.Framework.Scenes
m_clampPrimSize = true;
}
m_clampNegativeZ = startupConfig.GetBoolean("ClampNegativeZ", m_clampNegativeZ);
m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete);
m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);

View File

@ -296,13 +296,15 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X,
sceneObject.RootPart.GroupPosition.Y,
sceneObject.RootPart.GroupPosition.Z);
if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 ||
bool clampZ = m_parentScene.ClampNegativeZ;
if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || (npos.Z < 0.0 && clampZ) ||
npos.X > regionSizeX ||
npos.Y > regionSizeY))
{
if (npos.X < 0.0) npos.X = 1.0f;
if (npos.Y < 0.0) npos.Y = 1.0f;
if (npos.Z < 0.0) npos.Z = 0.0f;
if (npos.Z < 0.0 && clampZ) npos.Z = 0.0f;
if (npos.X > regionSizeX) npos.X = regionSizeX - 1.0f;
if (npos.Y > regionSizeY) npos.Y = regionSizeY - 1.0f;

View File

@ -138,6 +138,9 @@
; This can be overridden in the region config file.
ClampPrimSize = false
; If a prim is loaded from an external source, clamp it to Z = 0 if Z is negative.
ClampNegativeZ = false
; Maximum number of prims allowable in a linkset. Affects creating new linksets. Ignored if less than or equal to zero.
; This can be overridden in the region config file.
LinksetPrims = 0