diff options
author | Charles Krinke | 2008-08-27 02:49:47 +0000 |
---|---|---|
committer | Charles Krinke | 2008-08-27 02:49:47 +0000 |
commit | 363989195a3845940d0b2750e546c4eec10ec45a (patch) | |
tree | bf251bf5961dc1c28c5c9c817c03b4528a25744d | |
parent | Mantis#2052. Thank you kindly, Avdleeuw for a patch that: (diff) | |
download | opensim-SC-363989195a3845940d0b2750e546c4eec10ec45a.zip opensim-SC-363989195a3845940d0b2750e546c4eec10ec45a.tar.gz opensim-SC-363989195a3845940d0b2750e546c4eec10ec45a.tar.bz2 opensim-SC-363989195a3845940d0b2750e546c4eec10ec45a.tar.xz |
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.
-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); |