aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-05-26 00:54:00 +0100
committerJustin Clark-Casey (justincc)2012-05-26 00:54:00 +0100
commitf2a5fad18f30d24cd8911de829ecb1a07b475e38 (patch)
tree12f33a3406b1fb570654a6f91b5c70aba2b9764c /OpenSim
parentrefactor: replace LSL_Api.InventoryKey(string) largely with SceneObjectPartIn... (diff)
downloadopensim-SC_OLD-f2a5fad18f30d24cd8911de829ecb1a07b475e38.zip
opensim-SC_OLD-f2a5fad18f30d24cd8911de829ecb1a07b475e38.tar.gz
opensim-SC_OLD-f2a5fad18f30d24cd8911de829ecb1a07b475e38.tar.bz2
opensim-SC_OLD-f2a5fad18f30d24cd8911de829ecb1a07b475e38.tar.xz
Use SceneObjectPartInventory.GetInventoryItem() in OSSL.AvatarStopAnimation instead of searching the task inventory manually.
Diffstat (limited to 'OpenSim')
-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)