From 7f55db72d2c2be3d0e3396dc8a4ba8ca1f504fd3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 1 Apr 2019 13:58:41 +0100 Subject: Yengine: try fix changing scripts running state if the have long events --- OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs') diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs index 08c7e80..f68fd51 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRScriptThread.cs @@ -166,7 +166,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine if(inst == null) break; - if(inst.m_IState != XMRInstState.ONSTARTQ) + if (inst.m_IState == XMRInstState.SUSPENDED) + continue; + if (inst.m_IState != XMRInstState.ONSTARTQ) throw new Exception("bad state"); RunInstance(inst, tid); if(m_SuspendScriptThreadFlag || m_Exiting) @@ -187,7 +189,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine if(inst != null) { - if(inst.m_IState != XMRInstState.ONYIELDQ) + if (inst.m_IState == XMRInstState.SUSPENDED) + continue; + if (inst.m_IState != XMRInstState.ONYIELDQ) throw new Exception("bad state"); RunInstance(inst, tid); continue; -- cgit v1.1