Fix issue 1760. If the inventory item is not found, llSay() and throw an exception.
parent
3b35332957
commit
003487631d
|
@ -2900,6 +2900,12 @@ namespace OpenSim.Region.ScriptEngine.Common
|
|||
}
|
||||
}
|
||||
|
||||
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)
|
||||
|
|
|
@ -2771,6 +2771,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
}
|
||||
}
|
||||
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue