mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
* 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)
This commit is contained in:
@@ -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)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user