From 6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sat, 23 Jun 2012 04:11:31 -0400 Subject: Fix script "Running" behavior Unchecking "Running" box in script editor now persists. This fixes http://opensimulator.org/mantis/view.php?id=6057 --- OpenSim/Region/Framework/Interfaces/IScriptModule.cs | 2 ++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 14 ++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 0d488df..cbaf241 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs @@ -75,6 +75,8 @@ namespace OpenSim.Region.Framework.Interfaces /// The item ID of the script. bool GetScriptState(UUID itemID); + void SetRunEnable(UUID instanceID, bool enable); + void SaveAllState(); /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e413281..9ff8467 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2143,10 +2143,24 @@ namespace OpenSim.Region.Framework.Scenes if (part == null) return; + IScriptModule[] engines = RequestModuleInterfaces(); + if (running) + { + foreach (IScriptModule engine in engines) + { + engine.SetRunEnable(itemID, true); + } EventManager.TriggerStartScript(part.LocalId, itemID); + } else + { + foreach (IScriptModule engine in engines) + { + engine.SetRunEnable(itemID, false); + } EventManager.TriggerStopScript(part.LocalId, itemID); + } } public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) -- cgit v1.1