diff options
Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index e8e5e78..ee5eb90 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -78,7 +78,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
78 | if (regionHandle == m_regionInfo.RegionHandle) | 78 | if (regionHandle == m_regionInfo.RegionHandle) |
79 | { | 79 | { |
80 | // Teleport within the same region | 80 | // Teleport within the same region |
81 | if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0) | 81 | if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) |
82 | { | 82 | { |
83 | Vector3 emergencyPos = new Vector3(128, 128, 128); | 83 | Vector3 emergencyPos = new Vector3(128, 128, 128); |
84 | 84 | ||
@@ -90,7 +90,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
90 | // TODO: Get proper AVG Height | 90 | // TODO: Get proper AVG Height |
91 | float localAVHeight = 1.56f; | 91 | float localAVHeight = 1.56f; |
92 | 92 | ||
93 | float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y]; | 93 | float posZLimit = 22; |
94 | |||
95 | if (position.X > 0 && position.X <= (int)Constants.RegionSize && position.Y > 0 && position.Y <= (int)Constants.RegionSize) | ||
96 | { | ||
97 | posZLimit = (float) avatar.Scene.Heightmap[(int) position.X, (int) position.Y]; | ||
98 | } | ||
99 | |||
94 | float newPosZ = posZLimit + localAVHeight; | 100 | float newPosZ = posZLimit + localAVHeight; |
95 | if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) | 101 | if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) |
96 | { | 102 | { |