diff --git a/src/js/game/systems/filter.js b/src/js/game/systems/filter.js index 547b3e6c..e8008bf8 100644 --- a/src/js/game/systems/filter.js +++ b/src/js/game/systems/filter.js @@ -4,6 +4,8 @@ import { Entity } from "../entity"; import { GameSystemWithFilter } from "../game_system_with_filter"; import { BOOL_TRUE_SINGLETON } from "../items/boolean_item"; +const MAX_ITEMS_IN_QUEUE = 2; + export class FilterSystem extends GameSystemWithFilter { constructor(root) { super(root, [FilterComponent]); @@ -62,7 +64,7 @@ export class FilterSystem extends GameSystemWithFilter { listToCheck = filterComp.pendingItemsToReject; } - if (!listToCheck.length) { + if (listToCheck.length >= MAX_ITEMS_IN_QUEUE) { // Busy return false; } diff --git a/src/js/game/systems/item_acceptor.js b/src/js/game/systems/item_acceptor.js index 5b3ed3ca..db9bc7e1 100644 --- a/src/js/game/systems/item_acceptor.js +++ b/src/js/game/systems/item_acceptor.js @@ -70,7 +70,7 @@ export class ItemAcceptorSystem extends GameSystemWithFilter { if (!chunk.tileSpaceRectangle.containsPoint(realSlotPos.x, realSlotPos.y)) { // Not within this chunk - return; + continue; } const fadeOutDirection = diff --git a/src/js/game/systems/item_processor.js b/src/js/game/systems/item_processor.js index cbc3f204..3f700dff 100644 --- a/src/js/game/systems/item_processor.js +++ b/src/js/game/systems/item_processor.js @@ -285,11 +285,11 @@ export class ItemProcessorSystem extends GameSystemWithFilter { // only remove one item from each slot - we don't want to delete extra items! let usedSlots = []; for (let i = 0; i < acceptorComp.completedInputs.length; i++) { - const slot = acceptorComp.completedInputs[i].slotIndex; + const index = acceptorComp.completedInputs[i].slotIndex; - if (!usedSlots.includes(slot)) { - usedSlots.push(slot); - acceptorComp.completedInputs.splice(i); + if (!usedSlots.includes(index)) { + usedSlots.push(index); + acceptorComp.completedInputs.splice(i, 1); i--; } }