From 8f3c5dbe5c072b540ae446ddf57bf654c9f135d6 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 5 Nov 2008 15:26:10 +0000 Subject: * Apply second patch in http://opensimulator.org/mantis/view.php?id=2561 * Inserts proper animation state names into data/avataranimations.xml file so that llGetAnimation() works as one would expect. * Thanks StrawberryFride! --- OpenSim/Region/Environment/Scenes/AvatarAnimations.cs | 6 +++++- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs index 5417c8d..d4dd0db 100644 --- a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs +++ b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs @@ -35,6 +35,7 @@ namespace OpenSim.Region.Environment.Scenes { public Dictionary AnimsUUID = new Dictionary(); public Dictionary AnimsNames = new Dictionary(); + public Dictionary AnimStateNames = new Dictionary(); public AvatarAnimations() { @@ -46,11 +47,14 @@ namespace OpenSim.Region.Environment.Scenes { if (nod.Attributes["name"] != null) { - string name = (string)nod.Attributes["name"].Value; + string name = (string)nod.Attributes["name"].Value; UUID id = (UUID)nod.InnerText; + string animState = (string)nod.Attributes["state"].Value; AnimsUUID.Add(name, id); AnimsNames.Add(id, name); + if (animState != "") + AnimStateNames.Add(id, animState); } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 778cf9f..eefb8e6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3486,14 +3486,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence presence = World.GetScenePresence(avatar); if (m_host.RegionHandle == presence.RegionHandle) { - Dictionary animationNames = AnimationSet.Animations.AnimsNames; + Dictionary animationstateNames = AnimationSet.Animations.AnimStateNames; if (presence != null) { AnimationSet currentAnims = presence.Animations; - string currentAnimation = String.Empty; - if (animationNames.TryGetValue(currentAnims.DefaultAnimation.AnimID, out currentAnimation)) - return currentAnimation; + string currentAnimationState = String.Empty; + if (animationstateNames.TryGetValue(currentAnims.DefaultAnimation.AnimID, out currentAnimationState)) + return currentAnimationState; } } return String.Empty; -- cgit v1.1