From 0cf3ec553a79b05adf82b81fc71979a0636da32d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 18 Nov 2019 20:17:48 +0000 Subject: [PATCH] fix the block of teleport to same region handle --- .../EntityTransfer/EntityTransferModule.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index c55f535f3a..07b2a8ec80 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -559,22 +559,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (finalDestination == null) { - m_log.WarnFormat( "{0} Final destination is having problems. Unable to teleport {1} {2}: {3}", + m_log.WarnFormat( "{0} Unable to teleport {1} {2}: {3}", LogHeader, sp.Name, sp.UUID, reason); sp.ControllingClient.SendTeleportFailed(reason); return; } - // Check that these are not the same coordinates - if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX && - finalDestination.RegionLocY == sp.Scene.RegionInfo.RegionLocY) - { - // Can't do. Viewer crashes - sp.ControllingClient.SendTeleportFailed("Space warp! You would crash. Move to a different region and try again."); - return; - } - if (!ValidateGenericConditions(sp, reg, finalDestination, teleportFlags, out reason)) { sp.ControllingClient.SendTeleportFailed(reason); @@ -691,6 +682,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer ulong destinationHandle = finalDestination.RegionHandle; + if(destinationHandle == sourceRegion.RegionHandle) + { + sp.ControllingClient.SendTeleportFailed("Can't teleport to a region on same map position. Try going other region first, then retry"); + return; + } + // Let's do DNS resolution only once in this process, please! // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, // it's actually doing a lot of work.