Fix ReplaceOutfit toggling by explicitly detaching current items first

This commit is contained in:
RebeccaNod1 2026-05-08 17:57:48 -06:00
parent fb63cd6bd8
commit 5d679b3c7c

View file

@ -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 =>
{