From 2a9528fa225214557dac59fb9259086c5d99fbb6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 29 Sep 2014 23:16:01 +0100 Subject: Don't unnecessarily remove from backup objects that were not directly attached from the scene. These are never in region backup in the first place since recent 11830c43 Extend regression test to check backup status. --- .../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 7333769..609c559 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -387,7 +387,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (!Enabled) return false; - return AttachObjectInternal(sp, group, attachmentPt, silent, addToInventory, false, append); + group.DetachFromBackup(); + + bool success = AttachObjectInternal(sp, group, attachmentPt, silent, addToInventory, false, append); + + if (!success) + group.AttachToBackup(); + + return success; } /// @@ -815,8 +822,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments "[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}", so.Name, sp.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos); - so.DetachFromBackup(); - // Remove from database and parcel prim count m_scene.DeleteFromStorage(so.UUID); m_scene.EventManager.TriggerParcelPrimCountTainted(); -- cgit v1.1