From 5bb5eb4e374922d172218c1d70af1fa7f8ad56d6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 12 Jul 2016 16:33:09 +0100 Subject: [PATCH] don't break child agents start position --- OpenSim/Region/Framework/Scenes/Scene.cs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f2a0c32016..cf5705cf26 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4240,16 +4240,18 @@ namespace OpenSim.Region.Framework.Scenes // CleanDroppedAttachments(); // } - // Make sure avatar position is in the region (why it wouldn't be is a mystery but do sanity checking) - if (acd.startpos.X < 0) - acd.startpos.X = 1f; - else if (acd.startpos.X >= RegionInfo.RegionSizeX) - acd.startpos.X = RegionInfo.RegionSizeX - 1f; - if (acd.startpos.Y < 0) - acd.startpos.Y = 1f; - else if (acd.startpos.Y >= RegionInfo.RegionSizeY) - acd.startpos.Y = RegionInfo.RegionSizeY - 1f; - + if(teleportFlags != (uint) TPFlags.Default) + { + // Make sure root avatar position is in the region + if (acd.startpos.X < 0) + acd.startpos.X = 1f; + else if (acd.startpos.X >= RegionInfo.RegionSizeX) + acd.startpos.X = RegionInfo.RegionSizeX - 1f; + if (acd.startpos.Y < 0) + acd.startpos.Y = 1f; + else if (acd.startpos.Y >= RegionInfo.RegionSizeY) + acd.startpos.Y = RegionInfo.RegionSizeY - 1f; + } // only check access, actual relocations will happen later on ScenePresence MakeRoot // allow child agents creation if(!godlike && teleportFlags != (uint) TPFlags.Default)