From 71aa886d9a51b0f6b116091eb69f320b28177d28 Mon Sep 17 00:00:00 2001 From: Misode Date: Thu, 10 Nov 2022 22:03:13 +0100 Subject: [PATCH] Fix #303 filter items with count of 0 --- src/app/previews/LootTable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/previews/LootTable.ts b/src/app/previews/LootTable.ts index 70ac5f35..20856930 100644 --- a/src/app/previews/LootTable.ts +++ b/src/app/previews/LootTable.ts @@ -89,7 +89,7 @@ function fillContainer(items: Item[], ctx: LootContext): SlottedItem[] { } function assignSlots(items: Item[]): SlottedItem[] { - return items.map((item, i) => ({ slot: i, item })) + return items.flatMap((item, i) => item.count > 0 ? [({ slot: i, item })] : []) } function splitItem(item: Item, count: number): Item {