Mantis 6028 osAvatarStopAnimation not stopping animations via UUID

Corrected to stop animations using the animation UUID similar to llStopAnimation.
See http://opensimulator.org/wiki/OsAvatarStopAnimation
0.7.3-extended
Talun 2012-05-23 00:33:45 +01:00 committed by Justin Clark-Casey (justincc)
parent 58dc175ae3
commit 2021a8aedb
1 changed files with 11 additions and 7 deletions

View File

@ -955,16 +955,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ScenePresence target = (ScenePresence)World.Entities[avatarID]; ScenePresence target = (ScenePresence)World.Entities[avatarID];
if (target != null) if (target != null)
{ {
UUID animID = UUID.Zero; UUID animID = new UUID();
lock (m_host.TaskInventory) if (!UUID.TryParse(animation, out animID))
{ {
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) animID = UUID.Zero;
lock (m_host.TaskInventory)
{ {
if (inv.Value.Name == animation) foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{ {
if (inv.Value.Type == (int)AssetType.Animation) if (inv.Value.Name == animation)
animID = inv.Value.AssetID; {
continue; if (inv.Value.Type == (int)AssetType.Animation)
animID = inv.Value.AssetID;
continue;
}
} }
} }
} }