From 0149cef0c5af01d5dd1b4d190b71be67380ff016 Mon Sep 17 00:00:00 2001 From: Spencer Carlson Date: Tue, 10 Aug 2021 14:41:28 -0700 Subject: [PATCH] Add: A check in iten-container.add() method to ensure items added don't have quantity of zero. --- src/game-engine/world/items/item-container.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game-engine/world/items/item-container.ts b/src/game-engine/world/items/item-container.ts index c4fefbd3d..8596c717a 100644 --- a/src/game-engine/world/items/item-container.ts +++ b/src/game-engine/world/items/item-container.ts @@ -160,8 +160,8 @@ export class ItemContainer { return { item: newItem, slot: existingItemIndex }; } else { const newItemIndex = this.getFirstOpenSlot(); - if (newItemIndex === -1) { - // Not enough container space + if (newItemIndex === -1 || item.amount === 0) { + // Not enough container space, or the amount of item being added is 0. return null; }