diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 6a3c386154..545183bcf1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -699,42 +699,42 @@ namespace OpenSim.Region.Framework.Scenes { m_log.DebugFormat( "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation {0} within {1}", - position, m_regionInfo.RegionName); - - // Teleport within the same region - if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) - { - Vector3 emergencyPos = new Vector3(128, 128, 128); - - m_log.WarnFormat( - "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", - position, avatar.Name, avatar.UUID, emergencyPos); - position = emergencyPos; - } - - Vector3 currentPos = avatar.AbsolutePosition; - ILandObject srcLand = m_scene.LandChannel.GetLandObject(currentPos.X, currentPos.Y); - ILandObject destLand = m_scene.LandChannel.GetLandObject(position.X, position.Y); - if (srcLand != null && destLand != null && (teleportFlags & (uint)TeleportFlags.ViaLure) == 0 && (teleportFlags & (uint)TeleportFlags.ViaGodlikeLure) == 0) - { - if (srcLand.LandData.LocalID == destLand.LandData.LocalID) - { - //TPing within the same parcel. If the landing point is restricted, block the TP. - //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. - if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) - { - avatar.ControllingClient.SendAgentAlertMessage("Can't TP to the destination; landing point set.", false); - position = currentPos; - } - } - else - { - //Tping to a different parcel. Respect the landing point on the destination parcel. - if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) - { - position = destLand.LandData.UserLocation; - } - } + position, m_regionInfo.RegionName); + + // Teleport within the same region + if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0) + { + Vector3 emergencyPos = new Vector3(128, 128, 128); + + m_log.WarnFormat( + "[SCENE COMMUNICATION SERVICE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", + position, avatar.Name, avatar.UUID, emergencyPos); + position = emergencyPos; + } + + Vector3 currentPos = avatar.AbsolutePosition; + ILandObject srcLand = m_scene.LandChannel.GetLandObject(currentPos.X, currentPos.Y); + ILandObject destLand = m_scene.LandChannel.GetLandObject(position.X, position.Y); + if (srcLand != null && destLand != null && (teleportFlags & (uint)TeleportFlags.ViaLure) == 0 && (teleportFlags & (uint)TeleportFlags.ViaGodlikeLure) == 0) + { + if (srcLand.LandData.LocalID == destLand.LandData.LocalID) + { + //TPing within the same parcel. If the landing point is restricted, block the TP. + //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. + if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) + { + avatar.ControllingClient.SendAgentAlertMessage("Can't TP to the destination; landing point set.", false); + position = currentPos; + } + } + else + { + //Tping to a different parcel. Respect the landing point on the destination parcel. + if (destLand.LandData.LandingType == (byte)1 && destLand.LandData.UserLocation != Vector3.Zero && avatar.GodLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar.UUID) && destLand.LandData.OwnerID != avatar.UUID) + { + position = destLand.LandData.UserLocation; + } + } } // TODO: Get proper AVG Height