diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-28 19:42:28 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-28 19:42:28 -0400 |
commit | 9eb8c14e87986221f52872a697e49ec7059aa54b (patch) | |
tree | a211b891a37b0f911aa19b9b2cae524e618b732f /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | * Allow corner prim crossings. Previously this was only on a single cardinal... (diff) | |
download | opensim-SC-9eb8c14e87986221f52872a697e49ec7059aa54b.zip opensim-SC-9eb8c14e87986221f52872a697e49ec7059aa54b.tar.gz opensim-SC-9eb8c14e87986221f52872a697e49ec7059aa54b.tar.bz2 opensim-SC-9eb8c14e87986221f52872a697e49ec7059aa54b.tar.xz |
* Deal with teleports to other virtual regions in the same scene.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index dfd06bb..2c1d0e5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3267,16 +3267,47 @@ namespace OpenSim.Region.Framework.Scenes | |||
3267 | 3267 | ||
3268 | if (sp != null) | 3268 | if (sp != null) |
3269 | { | 3269 | { |
3270 | uint regionX = m_regInfo.RegionLocX; | ||
3271 | uint regionY = m_regInfo.RegionLocY; | ||
3272 | |||
3273 | Utils.LongToUInts(regionHandle, out regionX, out regionY); | ||
3274 | |||
3275 | int shiftx = (int) regionX - (int) m_regInfo.RegionLocX * (int)Constants.RegionSize; | ||
3276 | int shifty = (int)regionY - (int)m_regInfo.RegionLocY * (int)Constants.RegionSize; | ||
3277 | |||
3278 | position.X += shiftx; | ||
3279 | position.Y += shifty; | ||
3280 | |||
3281 | bool result = false; | ||
3282 | |||
3283 | if (TestBorderCross(position,Cardinals.N)) | ||
3284 | result = true; | ||
3285 | |||
3286 | if (TestBorderCross(position, Cardinals.S)) | ||
3287 | result = true; | ||
3288 | |||
3289 | if (TestBorderCross(position, Cardinals.E)) | ||
3290 | result = true; | ||
3291 | |||
3292 | if (TestBorderCross(position, Cardinals.W)) | ||
3293 | result = true; | ||
3294 | |||
3295 | // bordercross if position is outside of region | ||
3296 | |||
3297 | if (!result) | ||
3298 | regionHandle = m_regInfo.RegionHandle; | ||
3299 | |||
3270 | if (m_teleportModule != null) | 3300 | if (m_teleportModule != null) |
3271 | { | 3301 | { |
3272 | m_teleportModule.RequestTeleportToLocation(sp, regionHandle, | 3302 | m_teleportModule.RequestTeleportToLocation(sp, regionHandle, |
3273 | position, lookAt, teleportFlags); | 3303 | position, lookAt, teleportFlags); |
3274 | } | 3304 | } |
3275 | else | 3305 | else |
3276 | { | 3306 | { |
3277 | m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, | 3307 | m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, |
3278 | position, lookAt, teleportFlags); | 3308 | position, lookAt, teleportFlags); |
3279 | } | 3309 | } |
3310 | |||
3280 | } | 3311 | } |
3281 | } | 3312 | } |
3282 | 3313 | ||