diff options
author | UbitUmarov | 2018-11-14 19:02:00 +0000 |
---|---|---|
committer | UbitUmarov | 2018-11-14 19:02:00 +0000 |
commit | fad6295398cf0c7bbcc08cfae1efae495bfde29b (patch) | |
tree | 223e7f051306f9c0ab4d135bee0bc4b3d64d7c32 /OpenSim/Region/Framework/Scenes | |
parent | take friends out of basicDOSprot (too little, too late) (diff) | |
download | opensim-SC-fad6295398cf0c7bbcc08cfae1efae495bfde29b.zip opensim-SC-fad6295398cf0c7bbcc08cfae1efae495bfde29b.tar.gz opensim-SC-fad6295398cf0c7bbcc08cfae1efae495bfde29b.tar.bz2 opensim-SC-fad6295398cf0c7bbcc08cfae1efae495bfde29b.tar.xz |
change ossl link sound functions to search for sound both on script host and target prims
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs index f08ba59..94653d5 100644 --- a/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs +++ b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs | |||
@@ -93,15 +93,33 @@ namespace OpenSim.Region.Framework.Scenes.Scripting | |||
93 | public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier, AssetType type) | 93 | public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier, AssetType type) |
94 | { | 94 | { |
95 | UUID key; | 95 | UUID key; |
96 | if (UUID.TryParse(identifier, out key)) | ||
97 | return key; | ||
96 | 98 | ||
97 | if (!UUID.TryParse(identifier, out key)) | 99 | TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier); |
100 | if (item != null && item.Type == (int)type) | ||
101 | return item.AssetID; | ||
102 | |||
103 | return UUID.Zero; | ||
104 | } | ||
105 | |||
106 | public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, SceneObjectPart host, string identifier, AssetType type) | ||
107 | { | ||
108 | UUID key; | ||
109 | if (UUID.TryParse(identifier, out key)) | ||
110 | return key; | ||
111 | |||
112 | TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier); | ||
113 | if (item != null && item.Type == (int)type) | ||
114 | return item.AssetID; | ||
115 | |||
116 | if (part.LocalId != host.LocalId) | ||
98 | { | 117 | { |
99 | TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier); | 118 | item = host.Inventory.GetInventoryItem(identifier); |
100 | if (item != null && item.Type == (int)type) | 119 | if (item != null && item.Type == (int)type) |
101 | key = item.AssetID; | 120 | return item.AssetID; |
102 | } | 121 | } |
103 | 122 | return UUID.Zero; | |
104 | return key; | ||
105 | } | 123 | } |
106 | } | 124 | } |
107 | } \ No newline at end of file | 125 | } \ No newline at end of file |