Fix issue 1760. If the inventory item is not found, llSay() and throw an exception.
parent
3b35332957
commit
003487631d
|
@ -2899,6 +2899,12 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
break;
|
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
|
// check if destination is an avatar
|
||||||
if (World.GetScenePresence(destId) != null)
|
if (World.GetScenePresence(destId) != null)
|
||||||
|
@ -2911,9 +2917,6 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
// destination is an object
|
// destination is an object
|
||||||
World.MoveTaskInventoryItem(destId, m_host, objId);
|
World.MoveTaskInventoryItem(destId, m_host, objId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
|
||||||
llSay(0, "Could not find object " + inventory);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llRemoveInventory(string name)
|
public void llRemoveInventory(string name)
|
||||||
|
|
|
@ -2770,7 +2770,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
break;
|
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
|
// check if destination is an avatar
|
||||||
if (World.GetScenePresence(destId) != null)
|
if (World.GetScenePresence(destId) != null)
|
||||||
{
|
{
|
||||||
|
@ -2782,9 +2788,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
// destination is an object
|
// destination is an object
|
||||||
World.MoveTaskInventoryItem(destId, m_host, objId);
|
World.MoveTaskInventoryItem(destId, m_host, objId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
|
||||||
llSay(0, "Could not find object " + inventory);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llRemoveInventory(string item)
|
public void llRemoveInventory(string item)
|
||||||
|
|
Loading…
Reference in New Issue