From 003487631d0715ece515990d6b32b677a122e26b Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Wed, 23 Jul 2008 08:03:32 +0000 Subject: Fix issue 1760. If the inventory item is not found, llSay() and throw an exception. --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 68e7425..3129c19 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -2899,6 +2899,12 @@ namespace OpenSim.Region.ScriptEngine.Common break; } } + + if (!found) + { + llSay(0, String.Format("Could not find object '{0}'", inventory)); + throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); + } // check if destination is an avatar if (World.GetScenePresence(destId) != null) @@ -2911,9 +2917,6 @@ namespace OpenSim.Region.ScriptEngine.Common // destination is an object World.MoveTaskInventoryItem(destId, m_host, objId); } - - if (!found) - llSay(0, "Could not find object " + inventory); } public void llRemoveInventory(string name) -- cgit v1.1