Skip to content

Commit

Permalink
Add:
Browse files Browse the repository at this point in the history
A check in iten-container.add() method to ensure items added don't have quantity of zero.
  • Loading branch information
Spencer Carlson committed Aug 10, 2021
1 parent f88082c commit 0149cef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game-engine/world/items/item-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0149cef

Please sign in to comment.