From 7612c75f564239c04486b03e09a0f8767d71690c Mon Sep 17 00:00:00 2001 From: ZygZagGaming <46930418+ZygZagGaming@users.noreply.github.com> Date: Mon, 7 Feb 2022 22:11:24 -0500 Subject: [PATCH] thanks EmeraldBlock --- src/js/game/belt_path.js | 6 ++---- src/js/game/systems/item_ejector.js | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/js/game/belt_path.js b/src/js/game/belt_path.js index 11941d6d..c003d7aa 100644 --- a/src/js/game/belt_path.js +++ b/src/js/game/belt_path.js @@ -366,16 +366,14 @@ export class BeltPath extends BasicSerializableObject { return function (item) { // it could be a custom mod case // let's check if it is any of them - var any = false; // so that all matching components can process it for (let id in MOD_ITEM_FILTERS) { if (entity.components[id]) { let handler = MOD_ITEM_FILTERS[id]; - if (handler(item, entity, matchingSlotIndex)) any = true; - else return false; + if (handler(item, entity, matchingSlotIndex)) return true; } } - return any; + return false; }; } diff --git a/src/js/game/systems/item_ejector.js b/src/js/game/systems/item_ejector.js index ad4e64b5..74ee2fd3 100644 --- a/src/js/game/systems/item_ejector.js +++ b/src/js/game/systems/item_ejector.js @@ -302,16 +302,14 @@ export class ItemEjectorSystem extends GameSystemWithFilter { // it could be a custom mod case // let's check if it is any of them - var any = false; // so that all matching components can process it for (let id in MOD_ITEM_FILTERS) { if (receiver.components[id]) { let handler = MOD_ITEM_FILTERS[id]; - if (handler(item, receiver, slotIndex)) any = true; - else return false; + if (handler(item, receiver, slotIndex)) return true; } } - return any; + return false; } /**