diff options
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 | ||