diff --git a/SecondBotEvents/Services/CurrentOutfitFolder.cs b/SecondBotEvents/Services/CurrentOutfitFolder.cs index 89d1630..3b1d952 100644 --- a/SecondBotEvents/Services/CurrentOutfitFolder.cs +++ b/SecondBotEvents/Services/CurrentOutfitFolder.cs @@ -522,14 +522,16 @@ namespace SecondBotEvents.Services AddLink(item); } - // Detach all current non-body-part items first to avoid toggling - var currentWorn = ContentLinks().Select(RealInventoryItem).Where(i => !IsBodyPart(i)).ToList(); - if (currentWorn.Count > 0) - { - GetClient().Appearance.RemoveFromOutfit(currentWorn); - } + // Re-implementing ReplaceOutfit logic manually to ensure a clean swap without toggling. + var wearables = outfit.OfType().ToList(); + var attachments = outfit.Where(item => item is InventoryAttachment || item is InventoryObject).ToList(); + + // 1. Replace wearables (this is usually safe and doesn't toggle) + GetClient().Appearance.ReplaceOutfit(wearables.Cast().ToList()); + + // 2. Replace attachments with FirstDetachAll=true and replace=true to prevent toggling + GetClient().Appearance.AddAttachments(attachments, true, true); - GetClient().Appearance.ReplaceOutfit(outfit, false); ThreadPool.QueueUserWorkItem(sync => { Thread.Sleep(2000);