Reapply "mantis 9133 replace some z < 0 checks by < Constants.MinSimulationHeight (-100)"
This reverts commit cb1bde70db.
This commit is contained in:
@@ -63,6 +63,8 @@ namespace OpenSim.Framework
|
||||
public const float MinWaterHeight = 0;
|
||||
public const float MaxWaterHeight = 8000f;
|
||||
|
||||
public const float DefaultLandingBorderBuffer = 5.0f;
|
||||
|
||||
public const int MaxTextureResolution = 2048;
|
||||
|
||||
public static readonly string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f"; //plywood
|
||||
|
||||
@@ -683,39 +683,45 @@ namespace OpenSim.Framework
|
||||
private void DoDefaultLandingSanityChecks()
|
||||
{
|
||||
// Sanity Check Default Landing
|
||||
float buffer_zone = 5f;
|
||||
|
||||
bool ValuesCapped = false;
|
||||
|
||||
// Minimum Positions
|
||||
if (DefaultLandingPoint.X < buffer_zone)
|
||||
if (DefaultLandingPoint.X < Constants.DefaultLandingBorderBuffer)
|
||||
{
|
||||
DefaultLandingPoint.X = buffer_zone;
|
||||
DefaultLandingPoint.X = Constants.DefaultLandingBorderBuffer;
|
||||
ValuesCapped = true;
|
||||
}
|
||||
|
||||
if (DefaultLandingPoint.Y < buffer_zone)
|
||||
if (DefaultLandingPoint.Y < Constants.DefaultLandingBorderBuffer)
|
||||
{
|
||||
DefaultLandingPoint.Y = buffer_zone;
|
||||
DefaultLandingPoint.Y = Constants.DefaultLandingBorderBuffer;
|
||||
ValuesCapped = true;
|
||||
}
|
||||
|
||||
// Maximum Positions
|
||||
if (DefaultLandingPoint.X > RegionSizeX - buffer_zone)
|
||||
if (DefaultLandingPoint.X > RegionSizeX - Constants.DefaultLandingBorderBuffer)
|
||||
{
|
||||
DefaultLandingPoint.X = RegionSizeX - buffer_zone;
|
||||
DefaultLandingPoint.X = RegionSizeX - Constants.DefaultLandingBorderBuffer;
|
||||
ValuesCapped = true;
|
||||
}
|
||||
|
||||
if (DefaultLandingPoint.Y > RegionSizeY - buffer_zone)
|
||||
if (DefaultLandingPoint.Y > RegionSizeY - Constants.DefaultLandingBorderBuffer)
|
||||
{
|
||||
DefaultLandingPoint.Y = RegionSizeY - buffer_zone;
|
||||
DefaultLandingPoint.Y = RegionSizeY - Constants.DefaultLandingBorderBuffer;
|
||||
ValuesCapped = true;
|
||||
}
|
||||
|
||||
// Height
|
||||
if (DefaultLandingPoint.Z < 0f)
|
||||
DefaultLandingPoint.Z = 0f;
|
||||
if (DefaultLandingPoint.Z < Constants.MinSimulationHeight)
|
||||
{
|
||||
DefaultLandingPoint.Z = Constants.MinSimulationHeight;
|
||||
ValuesCapped = true;
|
||||
}
|
||||
else if (DefaultLandingPoint.Z > Constants.MaxSimulationHeight)
|
||||
{
|
||||
DefaultLandingPoint.Z = Constants.MaxSimulationHeight;
|
||||
ValuesCapped = true;
|
||||
}
|
||||
|
||||
if (ValuesCapped)
|
||||
m_log.WarnFormat("[RegionInfo]: The default landing location for {0} has been capped to {1}", RegionName, DefaultLandingPoint);
|
||||
|
||||
@@ -497,7 +497,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
sp.Name, position, m_sceneName);
|
||||
|
||||
// Teleport within the same region
|
||||
if (!m_scene.PositionIsInCurrentRegion(position) || position.Z < 0)
|
||||
if (!m_scene.PositionIsInCurrentRegion(position))
|
||||
{
|
||||
Vector3 emergencyPos = new(128, 128, 128);
|
||||
|
||||
@@ -520,6 +520,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
position.Z = posZLimit;
|
||||
}
|
||||
|
||||
if(position.Z < Constants.MinSimulationHeight)
|
||||
position.Z = Constants.MinSimulationHeight;
|
||||
else if(position.Z > Constants.MaxSimulationHeight)
|
||||
position.Z = Constants.MaxSimulationHeight;
|
||||
|
||||
/*
|
||||
if(!sp.CheckLocalTPLandingPoint(ref position))
|
||||
{
|
||||
|
||||
@@ -826,7 +826,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||
SceneObjectPart rootPart = g.RootPart;
|
||||
bool delete = false;
|
||||
|
||||
if (rootPart.GroupPosition.Z < 0.0 || rootPart.GroupPosition.Z > 10000.0)
|
||||
if (rootPart.GroupPosition.Z < Constants.MinSimulationHeight || rootPart.GroupPosition.Z > Constants.MaxSimulationHeight)
|
||||
{
|
||||
delete = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user