From 9eb8c14e87986221f52872a697e49ec7059aa54b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 28 Aug 2009 19:42:28 -0400 Subject: * Deal with teleports to other virtual regions in the same scene. --- OpenSim/Region/Framework/Scenes/Scene.cs | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') 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 if (sp != null) { + uint regionX = m_regInfo.RegionLocX; + uint regionY = m_regInfo.RegionLocY; + + Utils.LongToUInts(regionHandle, out regionX, out regionY); + + int shiftx = (int) regionX - (int) m_regInfo.RegionLocX * (int)Constants.RegionSize; + int shifty = (int)regionY - (int)m_regInfo.RegionLocY * (int)Constants.RegionSize; + + position.X += shiftx; + position.Y += shifty; + + bool result = false; + + if (TestBorderCross(position,Cardinals.N)) + result = true; + + if (TestBorderCross(position, Cardinals.S)) + result = true; + + if (TestBorderCross(position, Cardinals.E)) + result = true; + + if (TestBorderCross(position, Cardinals.W)) + result = true; + + // bordercross if position is outside of region + + if (!result) + regionHandle = m_regInfo.RegionHandle; + if (m_teleportModule != null) { m_teleportModule.RequestTeleportToLocation(sp, regionHandle, - position, lookAt, teleportFlags); + position, lookAt, teleportFlags); } else { m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, position, lookAt, teleportFlags); } + } } -- cgit v1.1