mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Update item_processor.js
Added a new variable check which removes the extra time spent outputting from a new charge
This commit is contained in:
parent
abb7ac782d
commit
26a5a54f3f
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user