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.)

inv-download
Justin Clark-Casey (justincc) 2015-03-12 00:14:30 +00:00
parent 7410924de0
commit 3a7d42378f
1 changed files with 4 additions and 3 deletions

View File

@ -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);