Actually remove the script if it tries to remove itself.
Fixes Mantis #2929
This commit is contained in:
@@ -168,6 +168,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
||||
|
||||
private ScriptEngine lastScriptEngine;
|
||||
private uint lastLocalID;
|
||||
private UUID lastItemID;
|
||||
|
||||
// Queue processing thread loop
|
||||
private void EventQueueThreadLoop()
|
||||
@@ -201,6 +202,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
||||
lastScriptEngine.World.DeleteSceneObject(
|
||||
part.ParentGroup, false);
|
||||
}
|
||||
catch (ScriptDeleteException) // Must delete item
|
||||
{
|
||||
SceneObjectPart part =
|
||||
lastScriptEngine.World.GetSceneObjectPart(
|
||||
lastLocalID);
|
||||
if (part != null && part.ParentGroup != null)
|
||||
part.Inventory.RemoveInventoryItem(lastItemID);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[{0}]: Exception {1} thrown", ScriptEngineName, e.GetType().ToString());
|
||||
@@ -284,6 +293,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
||||
QIS.localID))
|
||||
{
|
||||
lastLocalID = QIS.localID;
|
||||
lastItemID = QIS.itemID;
|
||||
LastExecutionStarted = DateTime.Now.Ticks;
|
||||
KillCurrentScript = false;
|
||||
InExecution = true;
|
||||
|
||||
Reference in New Issue
Block a user