Use SceneObjectPartInventory.GetInventoryItem() in OSSL.AvatarStopAnimation instead of searching the task inventory manually.
parent
ff53add54d
commit
f2a5fad18f
|
@ -952,27 +952,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID avatarID = (UUID)avatar;
|
UUID avatarID = (UUID)avatar;
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
// FIXME: What we really want to do here is factor out the similar code in llStopAnimation() to a common
|
||||||
|
// method (though see that doesn't do the is animation check, which is probably a bug) and have both
|
||||||
|
// these functions call that common code. However, this does mean navigating the brain-dead requirement
|
||||||
|
// of calling InitLSL()
|
||||||
if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence)
|
if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence)
|
||||||
{
|
{
|
||||||
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
ScenePresence target = (ScenePresence)World.Entities[avatarID];
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
UUID animID = new UUID();
|
UUID animID;
|
||||||
|
|
||||||
if (!UUID.TryParse(animation, out animID))
|
if (!UUID.TryParse(animation, out animID))
|
||||||
{
|
{
|
||||||
animID = UUID.Zero;
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(animation);
|
||||||
lock (m_host.TaskInventory)
|
if (item != null && item.Type == (int)AssetType.Animation)
|
||||||
{
|
animID = item.AssetID;
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
else
|
||||||
{
|
animID = UUID.Zero;
|
||||||
if (inv.Value.Name == animation)
|
|
||||||
{
|
|
||||||
if (inv.Value.Type == (int)AssetType.Animation)
|
|
||||||
animID = inv.Value.AssetID;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (animID == UUID.Zero)
|
if (animID == UUID.Zero)
|
||||||
|
|
Loading…
Reference in New Issue