diff options
author | Oren Hurvitz | 2012-04-23 19:07:36 +0300 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-27 20:47:02 +0100 |
commit | 6473674bbf6ce006512083902e8ff1796d8c8b22 (patch) | |
tree | 8f2e71c3c0442050789dc7e15334ad6e11ece27a /OpenSim/Region/Framework/Scenes/Animation | |
parent | If a Grid God teleports then include the Godlike teleport flag. This can affe... (diff) | |
download | opensim-SC-6473674bbf6ce006512083902e8ff1796d8c8b22.zip opensim-SC-6473674bbf6ce006512083902e8ff1796d8c8b22.tar.gz opensim-SC-6473674bbf6ce006512083902e8ff1796d8c8b22.tar.bz2 opensim-SC-6473674bbf6ce006512083902e8ff1796d8c8b22.tar.xz |
Fixed: custom walking animations didn't stop when the avatar stopped walking.
This happened because the scripts were notified about control changes (e.g., the user stopped pressing the Forward key) when the animation was still WALK, so the script didn't stop the walking animation. Fixing this required: a) Update the movement animation *before* notifying the script; b) Add locking to prevent clashes with the Heartbeat thread (which also updates the animations); c) Handle the case of a user who stops walking just as the avatar is in the air: the avatar should STAND in that case, not WALK.
This reverts commit feef1dd73243cfdd5322632fb67e64cabc1ad4bc.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Animation')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index f5623bd..14ae287 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -278,6 +278,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
278 | return "FALLDOWN"; | 278 | return "FALLDOWN"; |
279 | } | 279 | } |
280 | 280 | ||
281 | // Check if the user has stopped walking just now | ||
282 | if (CurrentMovementAnimation == "WALK" && (move == Vector3.Zero)) | ||
283 | return "STAND"; | ||
284 | |||
281 | return CurrentMovementAnimation; | 285 | return CurrentMovementAnimation; |
282 | } | 286 | } |
283 | 287 | ||
@@ -402,13 +406,16 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
402 | /// </summary> | 406 | /// </summary> |
403 | public void UpdateMovementAnimations() | 407 | public void UpdateMovementAnimations() |
404 | { | 408 | { |
405 | CurrentMovementAnimation = DetermineMovementAnimation(); | 409 | lock (m_animations) |
410 | { | ||
411 | CurrentMovementAnimation = DetermineMovementAnimation(); | ||
406 | 412 | ||
407 | // m_log.DebugFormat( | 413 | // m_log.DebugFormat( |
408 | // "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", | 414 | // "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", |
409 | // CurrentMovementAnimation, m_scenePresence.Name); | 415 | // CurrentMovementAnimation, m_scenePresence.Name); |
410 | 416 | ||
411 | TrySetMovementAnimation(CurrentMovementAnimation); | 417 | TrySetMovementAnimation(CurrentMovementAnimation); |
418 | } | ||
412 | } | 419 | } |
413 | 420 | ||
414 | public UUID[] GetAnimationArray() | 421 | public UUID[] GetAnimationArray() |