From b84417a220a17539cdf7c055082ef5c1a7e67c92 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 5 Nov 2008 14:02:36 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=2561 * This is a partial implementation of llGetAnimation that returns the name of the animation as stored in data/avataranimations.xml but not its state name (since we don't yet have these). * Thanks StrawberryFride --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b16125b..778cf9f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3482,7 +3482,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { // This should only return a value if the avatar is in the same region m_host.AddScriptLPS(1); - NotImplemented("llGetAnimation"); + UUID avatar = (UUID)id; + ScenePresence presence = World.GetScenePresence(avatar); + if (m_host.RegionHandle == presence.RegionHandle) + { + Dictionary animationNames = AnimationSet.Animations.AnimsNames; + + if (presence != null) + { + AnimationSet currentAnims = presence.Animations; + string currentAnimation = String.Empty; + if (animationNames.TryGetValue(currentAnims.DefaultAnimation.AnimID, out currentAnimation)) + return currentAnimation; + } + } return String.Empty; } -- cgit v1.1