aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs26
1 files changed, 12 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 5dbd9ec..7ea8b7a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -952,27 +952,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
952 UUID avatarID = (UUID)avatar; 952 UUID avatarID = (UUID)avatar;
953 953
954 m_host.AddScriptLPS(1); 954 m_host.AddScriptLPS(1);
955
956 // FIXME: What we really want to do here is factor out the similar code in llStopAnimation() to a common
957 // method (though see that doesn't do the is animation check, which is probably a bug) and have both
958 // these functions call that common code. However, this does mean navigating the brain-dead requirement
959 // of calling InitLSL()
955 if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence) 960 if (World.Entities.ContainsKey(avatarID) && World.Entities[avatarID] is ScenePresence)
956 { 961 {
957 ScenePresence target = (ScenePresence)World.Entities[avatarID]; 962 ScenePresence target = (ScenePresence)World.Entities[avatarID];
958 if (target != null) 963 if (target != null)
959 { 964 {
960 UUID animID = new UUID(); 965 UUID animID;
966
961 if (!UUID.TryParse(animation, out animID)) 967 if (!UUID.TryParse(animation, out animID))
962 { 968 {
963 animID = UUID.Zero; 969 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(animation);
964 lock (m_host.TaskInventory) 970 if (item != null && item.Type == (int)AssetType.Animation)
965 { 971 animID = item.AssetID;
966 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) 972 else
967 { 973 animID = UUID.Zero;
968 if (inv.Value.Name == animation)
969 {
970 if (inv.Value.Type == (int)AssetType.Animation)
971 animID = inv.Value.AssetID;
972 continue;
973 }
974 }
975 }
976 } 974 }
977 975
978 if (animID == UUID.Zero) 976 if (animID == UUID.Zero)