Fixes Mantis #3294. Thank you kindly, Godfrey, for a patch that:
Attached is a patch which provides osAvatarPlayAnimation() the ability to also trigger animations contained within the same prim as the script, as llStartAnimation() does. (It also modifies osAvatarStopAnimation(), otherwise the script wouldn't be able to stop animations it had started.)0.6.5-rc1
parent
9e4d9e2c3f
commit
9e0329f1dc
|
@ -593,7 +593,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (World.Entities.ContainsKey((UUID)avatar) && World.Entities[avatarID] is ScenePresence)
|
||||
{
|
||||
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
||||
target.AddAnimation(animation, m_host.UUID);
|
||||
if (target != null)
|
||||
{
|
||||
UUID animID=UUID.Zero;
|
||||
lock (m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (animID == UUID.Zero)
|
||||
target.AddAnimation(animation, m_host.UUID);
|
||||
else
|
||||
target.AddAnimation(animID, m_host.UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -607,7 +626,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence)
|
||||
{
|
||||
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
||||
target.RemoveAnimation(animation);
|
||||
if (target != null)
|
||||
{
|
||||
UUID animID=UUID.Zero;
|
||||
lock (m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (animID == UUID.Zero)
|
||||
target.RemoveAnimation(animation);
|
||||
else
|
||||
target.RemoveAnimation(animID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue