From 26a5a54f3f3dbd40552af8b38be7ca16530913c0 Mon Sep 17 00:00:00 2001 From: Sense101 <67970865+Sense101@users.noreply.github.com> Date: Sat, 2 Jan 2021 21:10:52 +0000 Subject: [PATCH] Update item_processor.js Added a new variable check which removes the extra time spent outputting from a new charge --- src/js/game/systems/item_processor.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/js/game/systems/item_processor.js b/src/js/game/systems/item_processor.js index 9775afde..95f0fca2 100644 --- a/src/js/game/systems/item_processor.js +++ b/src/js/game/systems/item_processor.js @@ -128,6 +128,8 @@ export class ItemProcessorSystem extends GameSystemWithFilter { // If the charge was entirely emptied to the outputs, start the next charge if (itemsToEject.length === 0) { processorComp.ongoingCharges.shift(); + } else { + processorComp.extraOutputTime += this.root.dynamicTickrate.deltaSeconds; } } } @@ -291,12 +293,15 @@ export class ItemProcessorSystem extends GameSystemWithFilter { } // Queue Charge - const baseSpeed = this.root.hubGoals.getProcessorBaseSpeed(processorComp.type); + let baseSpeed = this.root.hubGoals.getProcessorBaseSpeed(processorComp.type); const originalTime = 1 / baseSpeed; const bonusTimeToApply = Math.min(originalTime, processorComp.bonusTime); - const timeToProcess = originalTime - bonusTimeToApply; - + let timeToProcess = originalTime - bonusTimeToApply; + if(processorComp.extraOutputTime <= 1 / this.root.hubGoals.getBeltBaseSpeed()){ + timeToProcess -= processorComp.extraOutputTime; + } + processorComp.extraOutputTime = 0; processorComp.bonusTime -= bonusTimeToApply; processorComp.ongoingCharges.push({ items: outItems,