Mantis#1518. Thank you kindly, Zaki for a patch that:

Issue is caused by the terrain height not being queried before 
teleporting within the region. Teleporting between regions is 
correct. Adding the neccessary checking to intra-region TP code.
0.6.0-stable
Charles Krinke 2008-08-27 02:49:47 +00:00
parent e2b0852c93
commit 363989195a
1 changed files with 17 additions and 0 deletions

View File

@ -586,6 +586,23 @@ namespace OpenSim.Region.Environment.Scenes
if (regionHandle == m_regionInfo.RegionHandle) if (regionHandle == m_regionInfo.RegionHandle)
{ {
// Teleport within the same region // Teleport within the same region
if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0)
{
LLVector3 emergencyPos = new LLVector3(128, 128, 128);
m_log.WarnFormat(
"[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
position, avatar.Name, avatar.UUID, emergencyPos);
position = emergencyPos;
}
// TODO: Get proper AVG Height
float localAVHeight = 1.56f;
float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y);
float newPosZ = posZLimit + localAVHeight;
if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
{
position.Z = newPosZ;
}
avatar.ControllingClient.SendTeleportLocationStart(); avatar.ControllingClient.SendTeleportLocationStart();
avatar.ControllingClient.SendLocalTeleport(position, lookAt, flags); avatar.ControllingClient.SendLocalTeleport(position, lookAt, flags);
avatar.Teleport(position); avatar.Teleport(position);