* Fixes teleporting within megaregions on HG enabled regions. You can teleport around now. (but it still doesn't fix the inconsistent attachment state when teleporting into region slots that are not the south west region on megaregions)
parent
2995d87d75
commit
0a0b532270
|
@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
|||
if (regionHandle == m_regionInfo.RegionHandle)
|
||||
{
|
||||
// Teleport within the same region
|
||||
if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0)
|
||||
if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0)
|
||||
{
|
||||
Vector3 emergencyPos = new Vector3(128, 128, 128);
|
||||
|
||||
|
@ -89,7 +89,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
|||
// TODO: Get proper AVG Height
|
||||
float localAVHeight = 1.56f;
|
||||
|
||||
float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y];
|
||||
float posZLimit = 22;
|
||||
|
||||
if (position.X > 0 && position.X <= (int)Constants.RegionSize && position.Y > 0 && position.Y <= (int)Constants.RegionSize)
|
||||
{
|
||||
posZLimit = (float) avatar.Scene.Heightmap[(int) position.X, (int) position.Y];
|
||||
}
|
||||
|
||||
float newPosZ = posZLimit + localAVHeight;
|
||||
if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
|
||||
{
|
||||
|
|
|
@ -1170,7 +1170,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
private bool IsOutsideRegion(Scene s, Vector3 pos)
|
||||
protected bool IsOutsideRegion(Scene s, Vector3 pos)
|
||||
{
|
||||
|
||||
if (s.TestBorderCross(pos,Cardinals.N))
|
||||
|
|
Loading…
Reference in New Issue