diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index eb7f5ff..5f13278 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -230,7 +230,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
230 | /// <summary> | 230 | /// <summary> |
231 | /// Stop all the scripts in this prim. | 231 | /// Stop all the scripts in this prim. |
232 | /// </summary> | 232 | /// </summary> |
233 | public void RemoveScriptInstances() | 233 | /// <param name="sceneObjectBeingDeleted"> |
234 | /// Should be true if these scripts are being removed because the scene | ||
235 | /// object is being deleted. This will prevent spurious updates to the client. | ||
236 | /// </param> | ||
237 | public void RemoveScriptInstances(bool sceneObjectBeingDeleted) | ||
234 | { | 238 | { |
235 | lock (Items) | 239 | lock (Items) |
236 | { | 240 | { |
@@ -238,8 +242,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
238 | { | 242 | { |
239 | if ((int)InventoryType.LSL == item.InvType) | 243 | if ((int)InventoryType.LSL == item.InvType) |
240 | { | 244 | { |
241 | RemoveScriptInstance(item.ItemID); | 245 | RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted); |
242 | m_part.RemoveScriptEvents(item.ItemID); | ||
243 | } | 246 | } |
244 | } | 247 | } |
245 | } | 248 | } |
@@ -388,10 +391,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
388 | /// Stop a script which is in this prim's inventory. | 391 | /// Stop a script which is in this prim's inventory. |
389 | /// </summary> | 392 | /// </summary> |
390 | /// <param name="itemId"></param> | 393 | /// <param name="itemId"></param> |
391 | public void RemoveScriptInstance(UUID itemId) | 394 | /// <param name="sceneObjectBeingDeleted"> |
395 | /// Should be true if this script is being removed because the scene | ||
396 | /// object is being deleted. This will prevent spurious updates to the client. | ||
397 | /// </param> | ||
398 | public void RemoveScriptInstance(UUID itemId, bool sceneObjectBeingDeleted) | ||
392 | { | 399 | { |
393 | if (m_items.ContainsKey(itemId)) | 400 | if (m_items.ContainsKey(itemId)) |
394 | { | 401 | { |
402 | if (!sceneObjectBeingDeleted) | ||
403 | m_part.RemoveScriptEvents(itemId); | ||
404 | |||
395 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemId); | 405 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemId); |
396 | m_part.ParentGroup.AddActiveScriptCount(-1); | 406 | m_part.ParentGroup.AddActiveScriptCount(-1); |
397 | } | 407 | } |
@@ -465,7 +475,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
465 | if (i.Name == item.Name) | 475 | if (i.Name == item.Name) |
466 | { | 476 | { |
467 | if (i.InvType == (int)InventoryType.LSL) | 477 | if (i.InvType == (int)InventoryType.LSL) |
468 | RemoveScriptInstance(i.ItemID); | 478 | RemoveScriptInstance(i.ItemID, false); |
469 | 479 | ||
470 | RemoveInventoryItem(i.ItemID); | 480 | RemoveInventoryItem(i.ItemID); |
471 | break; | 481 | break; |
@@ -613,6 +623,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
613 | int type = m_items[itemID].InvType; | 623 | int type = m_items[itemID].InvType; |
614 | if (type == 10) // Script | 624 | if (type == 10) // Script |
615 | { | 625 | { |
626 | m_part.RemoveScriptEvents(itemID); | ||
616 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); | 627 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); |
617 | } | 628 | } |
618 | m_items.Remove(itemID); | 629 | m_items.Remove(itemID); |