From 463fbb4990226661238f1cc30587a5d1e270d44f Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 4 Aug 2010 00:17:02 -0700 Subject: If a user has no home position set, tell them so instead of leaving the request dangling --- .../Framework/EntityTransfer/EntityTransferModule.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 927eeab..1d1a0a1 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -549,6 +549,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (uinfo != null) { + if (uinfo.HomeRegionID == UUID.Zero) + { + // can't find the Home region: Tell viewer and abort + client.SendTeleportFailed("You don't have a home position set."); + return; + } GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); if (regionInfo == null) { @@ -556,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer client.SendTeleportFailed("Your home region could not be found."); return; } - m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", + m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point... @@ -564,6 +570,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); } + else + { + // can't find the Home region: Tell viewer and abort + client.SendTeleportFailed("Your home region could not be found."); + return; + } } #endregion -- cgit v1.1