From 3a7d42378f6ca230c8fe34641e21ca168869cec7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 Mar 2015 00:14:30 +0000 Subject: Move state change in progress in ScriptInstance.PostEvent() to the top of the EventQueue lock to avoid some flags possibly being wrongly set (m_LastControlLevel, etc.) --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index fe711d9..d78738f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -676,6 +676,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance lock (EventQueue) { + // The only events that persist across state changes are timers + if (m_StateChangeInProgress && data.EventName != "timer") + return; + if (EventQueue.Count >= m_MaxScriptQueue) return; @@ -719,9 +723,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance m_CollisionInQueue = true; } - - // The only events that persist across state changes are timers - if (m_StateChangeInProgress && data.EventName != "timer") return; EventQueue.Enqueue(data); -- cgit v1.1