From fe8e835bfc027696979ff0fb3135e5b2718af9ed Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sat, 28 Apr 2012 17:42:49 +0300 Subject: [PATCH] Fixed: scripted controls didn't work if the avatar was sitting down This fixes a bug introduced in 6473674bbf6ce006512083902e8ff1796d8c8b22 --- .../Region/Framework/Scenes/ScenePresence.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 64fe7a8e36..3cf7b2aa39 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1336,6 +1336,7 @@ namespace OpenSim.Region.Framework.Scenes PhysicsActor actor = PhysicsActor; if (actor == null) { + SafeSendControlsToScripts(flagsForScripts); return; } @@ -1512,20 +1513,25 @@ namespace OpenSim.Region.Framework.Scenes if (update_movementflag && ParentID == 0) Animator.UpdateMovementAnimations(); - lock (scriptedcontrols) - { - if (scriptedcontrols.Count > 0) - { - // Notify the scripts only after calling UpdateMovementAnimations(), so that if a script - // (e.g., a walking script) checks which animation is active it will be the correct animation. - SendControlToScripts(flagsForScripts); - } - } + SafeSendControlsToScripts(flagsForScripts); } m_scene.EventManager.TriggerOnClientMovement(this); } + private void SafeSendControlsToScripts(uint flagsForScripts) + { + lock (scriptedcontrols) + { + if (scriptedcontrols.Count > 0) + { + // Notify the scripts only after calling UpdateMovementAnimations(), so that if a script + // (e.g., a walking script) checks which animation is active it will be the correct animation. + SendControlToScripts(flagsForScripts); + } + } + } + /// /// Calculate an update to move the presence to the set target. ///