Fix ReplaceOutfit toggling by explicitly detaching current items first
This commit is contained in:
parent
fb63cd6bd8
commit
5d679b3c7c
1 changed files with 8 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using SecondBotEvents.Config;
|
using SecondBotEvents.Config;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
@ -522,6 +522,13 @@ namespace SecondBotEvents.Services
|
||||||
AddLink(item);
|
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);
|
GetClient().Appearance.ReplaceOutfit(outfit, false);
|
||||||
ThreadPool.QueueUserWorkItem(sync =>
|
ThreadPool.QueueUserWorkItem(sync =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue