From 5d679b3c7c0aeb7b05943039f371289b79065a81 Mon Sep 17 00:00:00 2001 From: RebeccaNod1 Date: Fri, 8 May 2026 17:57:48 -0600 Subject: [PATCH] Fix ReplaceOutfit toggling by explicitly detaching current items first --- SecondBotEvents/Services/CurrentOutfitFolder.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SecondBotEvents/Services/CurrentOutfitFolder.cs b/SecondBotEvents/Services/CurrentOutfitFolder.cs index d18d1e9..89d1630 100644 --- a/SecondBotEvents/Services/CurrentOutfitFolder.cs +++ b/SecondBotEvents/Services/CurrentOutfitFolder.cs @@ -1,4 +1,4 @@ -using OpenMetaverse; +using OpenMetaverse; using SecondBotEvents.Config; using System; using System.Collections.Generic; @@ -522,6 +522,13 @@ 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); + } + GetClient().Appearance.ReplaceOutfit(outfit, false); ThreadPool.QueueUserWorkItem(sync => {