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 ejectorComp = entity.components.ItemEjector;
// First of all, process the current recipe
processorComp.secondsUntilEject = Math.max(
0,
processorComp.secondsUntilEject - this.root.dynamicTickrate.deltaSeconds
);
if (processorComp.inputSlots.length >= processorComp.inputsPerCharge) {
// First of all, process the current recipe
processorComp.secondsUntilEject = Math.max(
0,
processorComp.secondsUntilEject - this.root.dynamicTickrate.deltaSeconds
);
if (G_IS_DEV && globalConfig.debug.instantProcessors) {
processorComp.secondsUntilEject = 0;
}
if (G_IS_DEV && globalConfig.debug.instantProcessors) {
processorComp.secondsUntilEject = 0;
}
if (
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
) {
if (processorComp.inputSlots.length >= processorComp.inputsPerCharge) {
if (
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
) {
const energyConsumerComp = entity.components.EnergyConsumer;
if (energyConsumerComp) {
// Check if we have enough energy