refactor: simplify code for checks when part.OwnerID != destPart.OwnerID in MoveTaskInventoryItem()

0.7.3-post-fixes
Justin Clark-Casey (justincc) 2012-03-22 22:40:38 +00:00
parent 4021709371
commit 4d15ad63bf
1 changed files with 8 additions and 11 deletions

View File

@ -1238,24 +1238,21 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
} }
// Can't transfer this if (part.OwnerID != destPart.OwnerID)
// {
if (part.OwnerID != destPart.OwnerID && (srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) // Source must have transfer permissions
if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
return; return;
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 on the destination
// object cannot copy items to an object owned by a different owner if ((destPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0)
// unless llAllowInventoryDrop has been called
return; return;
} }
// must have both move and modify permission to put an item in an object // must have both move and modify permission to put an item in an object
if ((part.OwnerMask & ((uint)PermissionMask.Move | (uint)PermissionMask.Modify)) == 0) if ((part.OwnerMask & ((uint)PermissionMask.Move | (uint)PermissionMask.Modify)) == 0)
{
return; return;
}
TaskInventoryItem destTaskItem = new TaskInventoryItem(); TaskInventoryItem destTaskItem = new TaskInventoryItem();