Fix llGiveInventory() so that it checks the destination part for AllowInventoryDrop, not the source.

This allows llAllowInventoryDrop() to work.
Regression test added for this case.
This commit is contained in:
Justin Clark-Casey (justincc)
2012-03-22 22:33:37 +00:00
parent 3bcf71c647
commit 760010d6fb
2 changed files with 63 additions and 6 deletions

View File

@@ -1210,9 +1210,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Copy a task (prim) inventory item to another task (prim)
/// </summary>
/// <param name="destId"></param>
/// <param name="part"></param>
/// <param name="itemId"></param>
/// <param name="destId">ID of destination part</param>
/// <param name="part">Source part</param>
/// <param name="itemId">Source item id to transfer</param>
public void MoveTaskInventoryItem(UUID destId, SceneObjectPart part, UUID itemId)
{
TaskInventoryItem srcTaskItem = part.Inventory.GetInventoryItem(itemId);
@@ -1240,10 +1240,10 @@ namespace OpenSim.Region.Framework.Scenes
// Can't transfer this
//
if ((part.OwnerID != destPart.OwnerID) && ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0))
if (part.OwnerID != destPart.OwnerID && (srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
return;
if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0)
if (part.OwnerID != destPart.OwnerID && (destPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0)
{
// object cannot copy items to an object owned by a different owner
// unless llAllowInventoryDrop has been called