diff options
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 6aa6de8..24f814e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -586,6 +586,23 @@ namespace OpenSim.Region.Environment.Scenes | |||
586 | if (regionHandle == m_regionInfo.RegionHandle) | 586 | if (regionHandle == m_regionInfo.RegionHandle) |
587 | { | 587 | { |
588 | // Teleport within the same region | 588 | // Teleport within the same region |
589 | if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0) | ||
590 | { | ||
591 | LLVector3 emergencyPos = new LLVector3(128, 128, 128); | ||
592 | |||
593 | m_log.WarnFormat( | ||
594 | "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", | ||
595 | position, avatar.Name, avatar.UUID, emergencyPos); | ||
596 | position = emergencyPos; | ||
597 | } | ||
598 | // TODO: Get proper AVG Height | ||
599 | float localAVHeight = 1.56f; | ||
600 | float posZLimit = (float)avatar.Scene.GetLandHeight((int)position.X, (int)position.Y); | ||
601 | float newPosZ = posZLimit + localAVHeight; | ||
602 | if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) | ||
603 | { | ||
604 | position.Z = newPosZ; | ||
605 | } | ||
589 | avatar.ControllingClient.SendTeleportLocationStart(); | 606 | avatar.ControllingClient.SendTeleportLocationStart(); |
590 | avatar.ControllingClient.SendLocalTeleport(position, lookAt, flags); | 607 | avatar.ControllingClient.SendLocalTeleport(position, lookAt, flags); |
591 | avatar.Teleport(position); | 608 | avatar.Teleport(position); |