From 4d5d6222f7edd7cd9c659571f280076c863a0fb1 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 29 Apr 2011 17:09:48 -0700 Subject: Delaying starting the scripts on TPs and crossings until the agent is root. --- OpenSim/Region/Framework/Scenes/Scene.cs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 696c6ee..2cbe4dc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1229,7 +1229,6 @@ namespace OpenSim.Region.Framework.Scenes // Increment the frame counter ++Frame; - try { // Check if any objects have reached their targets @@ -2336,9 +2335,13 @@ namespace OpenSim.Region.Framework.Scenes return false; } - newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); - - newObject.ResumeScripts(); + // For attachments, we need to wait until the agent is root + // before we restart the scripts, or else some functions won't work. + if (!newObject.IsAttachment) + { + newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); + newObject.ResumeScripts(); + } // Do this as late as possible so that listeners have full access to the incoming object EventManager.TriggerOnIncomingSceneObject(newObject); @@ -2455,17 +2458,8 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence sp = GetScenePresence(sog.OwnerID); if (sp != null) - { - AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(sp.UUID); + return sp.GetStateSource(); - if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default)) - { - // This will get your attention - //m_log.Error("[XXX] Triggering CHANGED_TELEPORT"); - - return 5; // StateSource.Teleporting - } - } return 2; // StateSource.PrimCrossing } -- cgit v1.1