aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs24
1 files changed, 15 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 64fe7a8..3cf7b2a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1336,6 +1336,7 @@ namespace OpenSim.Region.Framework.Scenes
1336 PhysicsActor actor = PhysicsActor; 1336 PhysicsActor actor = PhysicsActor;
1337 if (actor == null) 1337 if (actor == null)
1338 { 1338 {
1339 SafeSendControlsToScripts(flagsForScripts);
1339 return; 1340 return;
1340 } 1341 }
1341 1342
@@ -1512,20 +1513,25 @@ namespace OpenSim.Region.Framework.Scenes
1512 if (update_movementflag && ParentID == 0) 1513 if (update_movementflag && ParentID == 0)
1513 Animator.UpdateMovementAnimations(); 1514 Animator.UpdateMovementAnimations();
1514 1515
1515 lock (scriptedcontrols) 1516 SafeSendControlsToScripts(flagsForScripts);
1516 {
1517 if (scriptedcontrols.Count > 0)
1518 {
1519 // Notify the scripts only after calling UpdateMovementAnimations(), so that if a script
1520 // (e.g., a walking script) checks which animation is active it will be the correct animation.
1521 SendControlToScripts(flagsForScripts);
1522 }
1523 }
1524 } 1517 }
1525 1518
1526 m_scene.EventManager.TriggerOnClientMovement(this); 1519 m_scene.EventManager.TriggerOnClientMovement(this);
1527 } 1520 }
1528 1521
1522 private void SafeSendControlsToScripts(uint flagsForScripts)
1523 {
1524 lock (scriptedcontrols)
1525 {
1526 if (scriptedcontrols.Count > 0)
1527 {
1528 // Notify the scripts only after calling UpdateMovementAnimations(), so that if a script
1529 // (e.g., a walking script) checks which animation is active it will be the correct animation.
1530 SendControlToScripts(flagsForScripts);
1531 }
1532 }
1533 }
1534
1529 /// <summary> 1535 /// <summary>
1530 /// Calculate an update to move the presence to the set target. 1536 /// Calculate an update to move the presence to the set target.
1531 /// </summary> 1537 /// </summary>