Fix issue 1760. If the inventory item is not found, llSay() and throw an exception.

0.6.0-stable
Mike Mazur 2008-07-23 08:03:32 +00:00
parent 3b35332957
commit 003487631d
2 changed files with 13 additions and 7 deletions

View File

@ -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)

View File

@ -2770,7 +2770,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
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)
{
@ -2782,9 +2788,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// destination is an object
World.MoveTaskInventoryItem(destId, m_host, objId);
}
if (!found)
llSay(0, "Could not find object " + inventory);
}
public void llRemoveInventory(string item)