Yengine reset global variables possible damaged by bad state file

0.9.1.0-post-fixes
UbitUmarov 2018-12-11 00:42:02 +00:00
parent 11b467cabf
commit 1610595697
1 changed files with 7 additions and 6 deletions

View File

@ -401,6 +401,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
eventCode = ScriptEventCode.None; // not processing any event
// default state_entry() must initialize global variables
glblVars.AllocVarArrays(m_ObjCode.glblSizes); // reset globals
doGblInit = true;
stateCode = 0;
@ -526,11 +527,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
XmlElement doGblInitN = (XmlElement)scriptStateN.SelectSingleNode("DoGblInit");
doGblInit = bool.Parse(doGblInitN.InnerText);
XmlElement permissionsN = (XmlElement)scriptStateN.SelectSingleNode("Permissions");
m_Item.PermsGranter = new UUID(permissionsN.GetAttribute("granter"));
m_Item.PermsMask = Convert.ToInt32(permissionsN.GetAttribute("mask"));
m_Part.Inventory.UpdateInventoryItem(m_Item, false, false);
// get values used by stuff like llDetectedGrab, etc.
DetectParams[] detParams = RestoreDetectParams(scriptStateN.SelectSingleNode("DetectArray"));
@ -552,9 +548,14 @@ namespace OpenSim.Region.ScriptEngine.Yengine
MigrateInEventHandler(ms);
}
XmlElement permissionsN = (XmlElement)scriptStateN.SelectSingleNode("Permissions");
m_Item.PermsGranter = new UUID(permissionsN.GetAttribute("granter"));
m_Item.PermsMask = Convert.ToInt32(permissionsN.GetAttribute("mask"));
m_Part.Inventory.UpdateInventoryItem(m_Item, false, false);
// Restore event queues, preserving any events that queued
// whilst we were restoring the state
lock(m_QueueLock)
lock (m_QueueLock)
{
m_DetectParams = detParams;
foreach(EventParams evt in m_EventQueue)