mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
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 feef1dd732.
This commit is contained in:
committed by
Justin Clark-Casey (justincc)
parent
9622e8ac72
commit
6473674bbf
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -278,6 +278,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
return "FALLDOWN";
|
||||
}
|
||||
|
||||
// Check if the user has stopped walking just now
|
||||
if (CurrentMovementAnimation == "WALK" && (move == Vector3.Zero))
|
||||
return "STAND";
|
||||
|
||||
return CurrentMovementAnimation;
|
||||
}
|
||||
|
||||
@@ -402,13 +406,16 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
/// </summary>
|
||||
public void UpdateMovementAnimations()
|
||||
{
|
||||
CurrentMovementAnimation = DetermineMovementAnimation();
|
||||
lock (m_animations)
|
||||
{
|
||||
CurrentMovementAnimation = DetermineMovementAnimation();
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
|
||||
// CurrentMovementAnimation, m_scenePresence.Name);
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
|
||||
// CurrentMovementAnimation, m_scenePresence.Name);
|
||||
|
||||
TrySetMovementAnimation(CurrentMovementAnimation);
|
||||
TrySetMovementAnimation(CurrentMovementAnimation);
|
||||
}
|
||||
}
|
||||
|
||||
public UUID[] GetAnimationArray()
|
||||
|
||||
Reference in New Issue
Block a user