Show more meaningful error messages when failed to move an item from a prim to a user's inventory.

Also, actually show the error to the user in more cases. (Previously, sometimes the operation failed without telling the user anything.)
This commit is contained in:
Oren Hurvitz
2014-05-05 15:59:24 +03:00
parent 1e5cff32fc
commit eb79c882ea
4 changed files with 56 additions and 29 deletions

View File

@@ -4127,10 +4127,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
// destination is an avatar
InventoryItemBase agentItem = World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId);
string message;
InventoryItemBase agentItem = World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId, out message);
if (agentItem == null)
{
llSay(0, message);
return;
}
if (m_TransferModule != null)
{

View File

@@ -3397,14 +3397,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (sp == null)
return;
InventoryItemBase newItem = World.MoveTaskInventoryItem(sp.UUID, UUID.Zero, m_host, item.ItemID);
string message;
InventoryItemBase newItem = World.MoveTaskInventoryItem(sp.UUID, UUID.Zero, m_host, item.ItemID, out message);
if (newItem == null)
{
m_log.ErrorFormat(
"[OSSL API]: Could not create user inventory item {0} for {1}, attach point {2} in {3}",
itemName, m_host.Name, attachmentPoint, World.Name);
"[OSSL API]: Could not create user inventory item {0} for {1}, attach point {2} in {3}: {4}",
itemName, m_host.Name, attachmentPoint, World.Name, message);
((LSL_Api)m_LSL_Api).llSay(0, message);
return;
}