fix the block of teleport to same region handle

0.9.1.1
UbitUmarov 2019-11-18 20:17:48 +00:00
parent 730a35eedc
commit 0cf3ec553a
1 changed files with 7 additions and 10 deletions

View File

@ -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.