From 2864c45678a6e2557b6e2fda294d06cc8bfcec10 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 12 Apr 2009 12:03:07 +0000 Subject: Actually remove the script if it tries to remove itself. Fixes Mantis #2929 --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f4e7990..0964821 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3577,7 +3577,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Name == name) { - m_host.Inventory.RemoveInventoryItem(item.ItemID); + if (item.ItemID == m_itemID) + throw new ScriptDeleteException(); + else + m_host.Inventory.RemoveInventoryItem(item.ItemID); return; } } -- cgit v1.1