diff options
author | teravus | 2012-11-15 10:05:16 -0500 |
---|---|---|
committer | teravus | 2012-11-15 10:05:16 -0500 |
commit | e9153e1d1aae50024d8cd05fe14a9bce34343a0e (patch) | |
tree | bc111d34f95a26b99c7e34d9e495dc14d1802cc3 /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |
parent | Merge master into teravuswork (diff) | |
download | opensim-SC_OLD-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.zip opensim-SC_OLD-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.gz opensim-SC_OLD-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.bz2 opensim-SC_OLD-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.xz |
Revert "Merge master into teravuswork", it should have been avination, not master.
This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing
changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 58 |
1 files changed, 14 insertions, 44 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 3a9a146..e010864 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -97,15 +97,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
97 | QueryScriptStates(); | 97 | QueryScriptStates(); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | |||
101 | public int Count | ||
102 | { | ||
103 | get | ||
104 | { | ||
105 | lock (m_items) | ||
106 | return m_items.Count; | ||
107 | } | ||
108 | } | ||
109 | 100 | ||
110 | /// <summary> | 101 | /// <summary> |
111 | /// Constructor | 102 | /// Constructor |
@@ -244,52 +235,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
244 | if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null) | 235 | if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null) |
245 | return; | 236 | return; |
246 | 237 | ||
238 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
239 | if (engines == null) // No engine at all | ||
240 | return; | ||
241 | |||
247 | Items.LockItemsForRead(true); | 242 | Items.LockItemsForRead(true); |
248 | foreach (TaskInventoryItem item in Items.Values) | 243 | foreach (TaskInventoryItem item in Items.Values) |
249 | { | 244 | { |
250 | if (item.InvType == (int)InventoryType.LSL) | 245 | if (item.InvType == (int)InventoryType.LSL) |
251 | { | 246 | { |
252 | bool running; | 247 | foreach (IScriptModule e in engines) |
253 | if (TryGetScriptInstanceRunning(m_part.ParentGroup.Scene, item, out running)) | 248 | { |
254 | item.ScriptRunning = running; | 249 | bool running; |
250 | |||
251 | if (e.HasScript(item.ItemID, out running)) | ||
252 | { | ||
253 | item.ScriptRunning = running; | ||
254 | break; | ||
255 | } | ||
256 | } | ||
255 | } | 257 | } |
256 | } | 258 | } |
257 | 259 | ||
258 | Items.LockItemsForRead(false); | 260 | Items.LockItemsForRead(false); |
259 | } | 261 | } |
260 | 262 | ||
261 | public bool TryGetScriptInstanceRunning(UUID itemId, out bool running) | ||
262 | { | ||
263 | running = false; | ||
264 | |||
265 | TaskInventoryItem item = GetInventoryItem(itemId); | ||
266 | |||
267 | if (item == null) | ||
268 | return false; | ||
269 | |||
270 | return TryGetScriptInstanceRunning(m_part.ParentGroup.Scene, item, out running); | ||
271 | } | ||
272 | |||
273 | public static bool TryGetScriptInstanceRunning(Scene scene, TaskInventoryItem item, out bool running) | ||
274 | { | ||
275 | running = false; | ||
276 | |||
277 | if (item.InvType != (int)InventoryType.LSL) | ||
278 | return false; | ||
279 | |||
280 | IScriptModule[] engines = scene.RequestModuleInterfaces<IScriptModule>(); | ||
281 | if (engines == null) // No engine at all | ||
282 | return false; | ||
283 | |||
284 | foreach (IScriptModule e in engines) | ||
285 | { | ||
286 | if (e.HasScript(item.ItemID, out running)) | ||
287 | return true; | ||
288 | } | ||
289 | |||
290 | return false; | ||
291 | } | ||
292 | |||
293 | public int CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource) | 263 | public int CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource) |
294 | { | 264 | { |
295 | int scriptsValidForStarting = 0; | 265 | int scriptsValidForStarting = 0; |