* This doesn't fix mantis 3522, but it should mitigate it.

* If the start position is outside of the region on the X and Y, put the user in the center of the region and then damp the Z position at 720 if necessary.  If the start position is not outside of the region on the X or Y, then don't check the Z.
0.6.8-post-fixes
Teravus Ovares (Dan Olivares) 2009-11-22 20:21:33 -05:00
parent c155099faf
commit 0ff3c28f90
1 changed files with 43 additions and 0 deletions

View File

@ -3470,6 +3470,49 @@ namespace OpenSim.Region.Framework.Scenes
agent.startpos.Y = crossedBorder.BorderLine.Z - 1;
}
//Mitigate http://opensimulator.org/mantis/view.php?id=3522
// Check if start position is outside of region
// If it is, check the Z start position also.. if not, leave it alone.
if (BordersLocked)
{
lock (EastBorders)
{
if (agent.startpos.X > EastBorders[0].BorderLine.Z)
{
m_log.Warn("FIX AGENT POSITION");
agent.startpos.X = EastBorders[0].BorderLine.Z * 0.5f;
if (agent.startpos.Z > 720)
agent.startpos.Z = 720;
}
}
lock (NorthBorders)
{
if (agent.startpos.Y > NorthBorders[0].BorderLine.Z)
{
m_log.Warn("FIX Agent POSITION");
agent.startpos.Y = NorthBorders[0].BorderLine.Z * 0.5f;
if (agent.startpos.Z > 720)
agent.startpos.Z = 720;
}
}
}
else
{
if (agent.startpos.X > EastBorders[0].BorderLine.Z)
{
m_log.Warn("FIX AGENT POSITION");
agent.startpos.X = EastBorders[0].BorderLine.Z * 0.5f;
if (agent.startpos.Z > 720)
agent.startpos.Z = 720;
}
if (agent.startpos.Y > NorthBorders[0].BorderLine.Z)
{
m_log.Warn("FIX Agent POSITION");
agent.startpos.Y = NorthBorders[0].BorderLine.Z * 0.5f;
if (agent.startpos.Z > 720)
agent.startpos.Z = 720;
}
}
// Honor parcel landing type and position.
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
if (land != null)