Skip to content

Commit

Permalink
Merge pull request #340 from src52/no-zero-items
Browse files Browse the repository at this point in the history
Add check to item-container.add() method.
  • Loading branch information
Tynarus authored Aug 10, 2021
2 parents b465995 + e59385d commit b1f077a
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 b1f077a

Please sign in to comment.