1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Fixed to wait when input is ready

This commit is contained in:
isaisstillalive 2020-07-10 12:29:24 +09:00
parent 0c67da5a16
commit 69bf3f0951

View File

@ -19,21 +19,21 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
const processorComp = entity.components.ItemProcessor; const processorComp = entity.components.ItemProcessor;
const ejectorComp = entity.components.ItemEjector; const ejectorComp = entity.components.ItemEjector;
// First of all, process the current recipe if (processorComp.inputSlots.length >= processorComp.inputsPerCharge) {
processorComp.secondsUntilEject = Math.max( // First of all, process the current recipe
0, processorComp.secondsUntilEject = Math.max(
processorComp.secondsUntilEject - this.root.dynamicTickrate.deltaSeconds 0,
); processorComp.secondsUntilEject - this.root.dynamicTickrate.deltaSeconds
);
if (G_IS_DEV && globalConfig.debug.instantProcessors) { if (G_IS_DEV && globalConfig.debug.instantProcessors) {
processorComp.secondsUntilEject = 0; processorComp.secondsUntilEject = 0;
} }
if ( if (
processorComp.secondsUntilEject === 0 && // it was processed in time processorComp.secondsUntilEject === 0 && // it was processed in time
processorComp.itemsToEject.length === 0 // Check if we have an empty queue and can start a new charge processorComp.itemsToEject.length === 0 // Check if we have an empty queue and can start a new charge
) { ) {
if (processorComp.inputSlots.length >= processorComp.inputsPerCharge) {
const energyConsumerComp = entity.components.EnergyConsumer; const energyConsumerComp = entity.components.EnergyConsumer;
if (energyConsumerComp) { if (energyConsumerComp) {
// Check if we have enough energy // Check if we have enough energy