diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index dc3f57a81d..0266faf821 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3903,16 +3903,6 @@ namespace OpenSim.Region.Framework.Scenes sp.LifecycleState = ScenePresenceState.Running; - - //HACK part A - // kill in viewers sp.localID that they may still know about - - SendKillObject(new List { sp.LocalId }); - - //HACK part B - // keep using same localID - - if (EntityTransferModule.IsInTransit(sp.UUID)) { sp.DoNotCloseAfterTeleport = true; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3c7e4a2b6b..1ace0d9dd5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1767,10 +1767,20 @@ namespace OpenSim.Region.Framework.Scenes // Make sure it's not a login agent. We don't want to wait for updates during login if (!isNPC && (m_teleportFlags & TeleportFlags.ViaLogin) == 0) { + // Let's wait until UpdateAgent (called by departing region) is done if (!WaitForUpdateAgent(client)) // The sending region never sent the UpdateAgent data, we have to refuse return; + + //HACK part A + // kill in viewers sp.localID that they may still know about + m_log.DebugFormat("[CompleteMovement] send old child kills"); + m_scene.SendKillObject(new List { LocalId }); + + //HACK part B + // keep using same localID + } // Prevent teleporting to an underground location