From 59da146e9dd678aea2e0bd3e16ef178c183754a0 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Fri, 7 Aug 2015 16:35:32 +0300 Subject: When the user stops a script, have it remain stopped Previously the script state was never saved for a !Running script, so upon region restart the script would be Running again. The use of the 'StayStopped' flag is needed because all scripts are automatically stopped when the region shuts down, but in that case we shouldn't save in their state that they're !Running. --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 5071884..62bf803 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -699,6 +699,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine { if (instance.Running) { + instance.StayStopped = true; // the script was stopped explicitly + instance.Stop(0); SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID); @@ -1914,6 +1916,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (instance != null) { + lock (instance.EventQueue) + instance.StayStopped = true; // the script was stopped explicitly + instance.Stop(m_WaitForEventCompletionOnScriptStop); } else -- cgit v1.1