* 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 StrawberryFride0.6.0-stable
parent
8bacdbd49c
commit
b84417a220
|
@ -3482,7 +3482,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
// This should only return a value if the avatar is in the same region
|
// This should only return a value if the avatar is in the same region
|
||||||
m_host.AddScriptLPS(1);
|
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;
|
return String.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue