diff options
author | Teravus Ovares (Dan Olivares) | 2009-09-25 15:31:19 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-09-25 15:31:19 -0400 |
commit | 0a0b532270d7cc952648b99ed7ab7ec3b0f99676 (patch) | |
tree | 4f1ec1d7f9b4da09ca28ddb8806c189897795b5e /OpenSim/Region | |
parent | minor: remove some mono compiler warnings (diff) | |
download | opensim-SC-0a0b532270d7cc952648b99ed7ab7ec3b0f99676.zip opensim-SC-0a0b532270d7cc952648b99ed7ab7ec3b0f99676.tar.gz opensim-SC-0a0b532270d7cc952648b99ed7ab7ec3b0f99676.tar.bz2 opensim-SC-0a0b532270d7cc952648b99ed7ab7ec3b0f99676.tar.xz |
* 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)
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index 5c99d73..efc644d 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
77 | if (regionHandle == m_regionInfo.RegionHandle) | 77 | if (regionHandle == m_regionInfo.RegionHandle) |
78 | { | 78 | { |
79 | // Teleport within the same region | 79 | // Teleport within the same region |
80 | if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0) | 80 | if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) |
81 | { | 81 | { |
82 | Vector3 emergencyPos = new Vector3(128, 128, 128); | 82 | Vector3 emergencyPos = new Vector3(128, 128, 128); |
83 | 83 | ||
@@ -89,7 +89,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid | |||
89 | // TODO: Get proper AVG Height | 89 | // TODO: Get proper AVG Height |
90 | float localAVHeight = 1.56f; | 90 | float localAVHeight = 1.56f; |
91 | 91 | ||
92 | float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y]; | 92 | float posZLimit = 22; |
93 | |||
94 | if (position.X > 0 && position.X <= (int)Constants.RegionSize && position.Y > 0 && position.Y <= (int)Constants.RegionSize) | ||
95 | { | ||
96 | posZLimit = (float) avatar.Scene.Heightmap[(int) position.X, (int) position.Y]; | ||
97 | } | ||
98 | |||
93 | float newPosZ = posZLimit + localAVHeight; | 99 | float newPosZ = posZLimit + localAVHeight; |
94 | if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) | 100 | if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) |
95 | { | 101 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 56cd87d..5f2333e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -1170,7 +1170,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1170 | } | 1170 | } |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | private bool IsOutsideRegion(Scene s, Vector3 pos) | 1173 | protected bool IsOutsideRegion(Scene s, Vector3 pos) |
1174 | { | 1174 | { |
1175 | 1175 | ||
1176 | if (s.TestBorderCross(pos,Cardinals.N)) | 1176 | if (s.TestBorderCross(pos,Cardinals.N)) |