mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
cosmetics
This commit is contained in:
@@ -1214,9 +1214,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
if (script.StartsWith("//MRM:"))
|
||||
return;
|
||||
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
|
||||
|
||||
if(!m_LateInit)
|
||||
{
|
||||
m_LateInit = true;
|
||||
@@ -1281,6 +1278,9 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
if(!string.IsNullOrEmpty(langsrt) && langsrt !="lsl")
|
||||
return;
|
||||
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
|
||||
|
||||
// Put on object/instance lists.
|
||||
XMRInstance instance = (XMRInstance)Activator.CreateInstance(ScriptCodeGen.xmrInstSuperType);
|
||||
instance.m_LocalID = localID;
|
||||
@@ -1411,6 +1411,10 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
if(!instance.m_Running)
|
||||
instance.EmptyEventQueues();
|
||||
}
|
||||
// Declare which events the script's current state can handle.
|
||||
int eventMask = instance.GetStateEventFlags(instance.stateCode);
|
||||
instance.m_Part.SetScriptEvents(instance.m_ItemID, eventMask);
|
||||
|
||||
QueueToStart(instance);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,10 +126,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
|
||||
suspendOnCheckRunHold = false;
|
||||
suspendOnCheckRunTemp = false;
|
||||
|
||||
// Declare which events the script's current state can handle.
|
||||
int eventMask = GetStateEventFlags(stateCode);
|
||||
m_Part.SetScriptEvents(m_ItemID, eventMask);
|
||||
}
|
||||
|
||||
private void InitScriptApi(Yengine engine, string api, IScriptApi scriptApi)
|
||||
|
||||
@@ -213,24 +213,23 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
* @brief For a given stateCode, get a mask of the low 32 event codes
|
||||
* that the state has handlers defined for.
|
||||
*/
|
||||
public int GetStateEventFlags(int stateCode)
|
||||
public int GetStateEventFlags(int state)
|
||||
{
|
||||
if((stateCode < 0) ||
|
||||
(stateCode >= m_ObjCode.scriptEventHandlerTable.GetLength(0)))
|
||||
if((state < 0) ||
|
||||
(state >= m_ObjCode.scriptEventHandlerTable.GetLength(0)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int code = 0;
|
||||
int flags = 0;
|
||||
for(int i = 0; i < 32; i++)
|
||||
{
|
||||
if(m_ObjCode.scriptEventHandlerTable[stateCode, i] != null)
|
||||
if(m_ObjCode.scriptEventHandlerTable[state, i] != null)
|
||||
{
|
||||
code |= 1 << i;
|
||||
flags |= 1 << i;
|
||||
}
|
||||
}
|
||||
|
||||
return code;
|
||||
return flags;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user