* 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
0.6.0-stable
Justin Clarke Casey 2008-11-05 14:02:36 +00:00
parent 8bacdbd49c
commit b84417a220
1 changed files with 14 additions and 1 deletions

View File

@ -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<UUID, string> 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;
}