diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 550ab87e5e..4337b5a2d8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -411,6 +411,8 @@ namespace OpenSim.Region.Framework.Scenes // itemUpd.NextPermissions, itemUpd.GroupPermissions, itemUpd.EveryOnePermissions, item.Flags, // item.NextPermissions, item.GroupPermissions, item.EveryOnePermissions, item.CurrentPermissions); + bool sendUpdate = false; + if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid { // Create a set of base permissions that will not include export if the user @@ -484,11 +486,13 @@ namespace OpenSim.Region.Framework.Scenes item.SalePrice = itemUpd.SalePrice; item.SaleType = itemUpd.SaleType; - InventoryService.UpdateItem(item); + if (item.InvType == (int)InventoryType.Wearable && (item.Flags & 0xf) == 0 && (itemUpd.Flags & 0xf) != 0) + { + item.Flags = (uint)(item.Flags & 0xfffffff0) | (itemUpd.Flags & 0xf); + sendUpdate = true; + } - // We cannot send out a bulk update here, since this will cause editing of clothing to start - // failing frequently. Possibly this is a race with a separate transaction that uploads the asset. -// remoteClient.SendBulkUpdateInventory(item); + InventoryService.UpdateItem(item); } if (UUID.Zero != transactionID) @@ -498,6 +502,14 @@ namespace OpenSim.Region.Framework.Scenes AgentTransactionsModule.HandleItemUpdateFromTransaction(remoteClient, transactionID, item); } } + else + { + // This MAY be problematic, if it is, another solution + // needs to be found. If inventory item flags are updated + // the viewer's notion of the item needs to be refreshed. + if (sendUpdate) + remoteClient.SendBulkUpdateInventory(item); + } } else {