From 191b0888a26c02253dd5ef8b12ba7e95c8d85279 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 12 Nov 2018 23:21:08 +0000 Subject: [PATCH] a few changes to deattach object update --- .../Avatar/Attachments/AttachmentsModule.cs | 14 ++++++++++---- .../InventoryAccess/InventoryAccessModule.cs | 5 ----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 3b19ec802a..d1a52cbb2d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -997,18 +997,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments (uint)PermissionMask.Export | (uint)PermissionMask.FoldedMask); // Preserve folded permissions ?? + string name = grp.RootPart.Name; + string desc = grp.RootPart.Description; + AssetBase asset = m_scene.CreateAsset( - grp.GetPartName(grp.LocalId), - grp.GetPartDescription(grp.LocalId), + name, desc, (sbyte)AssetType.Object, Utils.StringToBytes(sceneObjectXml), sp.UUID); + item.Name = name; + item.Description = desc; + item.AssetID = asset.FullID; + item.AssetType = (int)AssetType.Object; + item.InvType = (int)InventoryType.Object; + if (m_invAccessModule != null) m_invAccessModule.UpdateInventoryItemAsset(sp.UUID, item, asset); - // If the name of the object has been changed whilst attached then we want to update the inventory - // item in the viewer. if (sp.ControllingClient != null) sp.ControllingClient.SendInventoryItemCreateUpdate(item, 0); } diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 788ed1c667..8dfe5c1407 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -333,11 +333,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // "[INVENTORY ACCESS MODULE]: Updating item {0} {1} with new asset {2}", // item.Name, item.ID, asset.ID); - item.AssetID = asset.FullID; - item.Description = asset.Description; - item.Name = asset.Name; - item.AssetType = asset.Type; - item.InvType = (int)InventoryType.Object; m_Scene.AssetService.Store(asset); m_Scene.InventoryService.UpdateItem(item);