diff options
author | Mike Mazur | 2008-07-23 08:03:32 +0000 |
---|---|---|
committer | Mike Mazur | 2008-07-23 08:03:32 +0000 |
commit | 003487631d0715ece515990d6b32b677a122e26b (patch) | |
tree | 57fede0ed6b7d47a5e97b7c778e2bd618f7c3dfc /OpenSim | |
parent | adding files that were not included in r5589 (diff) | |
download | opensim-SC_OLD-003487631d0715ece515990d6b32b677a122e26b.zip opensim-SC_OLD-003487631d0715ece515990d6b32b677a122e26b.tar.gz opensim-SC_OLD-003487631d0715ece515990d6b32b677a122e26b.tar.bz2 opensim-SC_OLD-003487631d0715ece515990d6b32b677a122e26b.tar.xz |
Fix issue 1760. If the inventory item is not found, llSay() and throw an exception.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 11 |
2 files changed, 13 insertions, 7 deletions
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 | |||
2899 | break; | 2899 | break; |
2900 | } | 2900 | } |
2901 | } | 2901 | } |
2902 | |||
2903 | if (!found) | ||
2904 | { | ||
2905 | llSay(0, String.Format("Could not find object '{0}'", inventory)); | ||
2906 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); | ||
2907 | } | ||
2902 | 2908 | ||
2903 | // check if destination is an avatar | 2909 | // check if destination is an avatar |
2904 | if (World.GetScenePresence(destId) != null) | 2910 | if (World.GetScenePresence(destId) != null) |
@@ -2911,9 +2917,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2911 | // destination is an object | 2917 | // destination is an object |
2912 | World.MoveTaskInventoryItem(destId, m_host, objId); | 2918 | World.MoveTaskInventoryItem(destId, m_host, objId); |
2913 | } | 2919 | } |
2914 | |||
2915 | if (!found) | ||
2916 | llSay(0, "Could not find object " + inventory); | ||
2917 | } | 2920 | } |
2918 | 2921 | ||
2919 | public void llRemoveInventory(string name) | 2922 | public void llRemoveInventory(string name) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f3e9b09..ac4d43a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2770,7 +2770,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2770 | break; | 2770 | break; |
2771 | } | 2771 | } |
2772 | } | 2772 | } |
2773 | 2773 | ||
2774 | if (!found) | ||
2775 | { | ||
2776 | llSay(0, String.Format("Could not find object '{0}'", inventory)); | ||
2777 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); | ||
2778 | } | ||
2779 | |||
2774 | // check if destination is an avatar | 2780 | // check if destination is an avatar |
2775 | if (World.GetScenePresence(destId) != null) | 2781 | if (World.GetScenePresence(destId) != null) |
2776 | { | 2782 | { |
@@ -2782,9 +2788,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2782 | // destination is an object | 2788 | // destination is an object |
2783 | World.MoveTaskInventoryItem(destId, m_host, objId); | 2789 | World.MoveTaskInventoryItem(destId, m_host, objId); |
2784 | } | 2790 | } |
2785 | |||
2786 | if (!found) | ||
2787 | llSay(0, "Could not find object " + inventory); | ||
2788 | } | 2791 | } |
2789 | 2792 | ||
2790 | public void llRemoveInventory(string item) | 2793 | public void llRemoveInventory(string item) |