Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions OrderbotTags/LLDiscardItem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.ComponentModel;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using Buddy.Coroutines;
Expand All @@ -20,6 +20,10 @@ public class LLDiscardItem : LLProfileBehavior
[DefaultValue(new int[0])]
private int[] ItemIds { get; set; }

[XmlAttribute("Armory")]
[DefaultValue(false)]
public bool IncludeArmory { get; set; }

private bool _isDone;

public override bool HighPriority => true;
Expand Down Expand Up @@ -54,7 +58,10 @@ private async Task DiscardItems()
return;
}

var slots = InventoryManager.FilledSlots.Where(x => ItemIds.Contains((int)x.RawItemId)).ToList();
// Use FilledInventoryAndArmory if Armory is true, otherwise just FilledSlots
var slots = (IncludeArmory ? InventoryManager.FilledInventoryAndArmory : InventoryManager.FilledSlots)
.Where(x => ItemIds.Contains((int)x.RawItemId))
.ToList();

if (!slots.Any())
{
Expand Down Expand Up @@ -82,4 +89,4 @@ private async Task DiscardItems()
_isDone = true;
}
}
}
}