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,6 +19,7 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
const processorComp = entity.components.ItemProcessor;
const ejectorComp = entity.components.ItemEjector;
if (processorComp.inputSlots.length >= processorComp.inputsPerCharge) {
// First of all, process the current recipe
processorComp.secondsUntilEject = Math.max(
0,
@ -33,7 +34,6 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
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) {
const energyConsumerComp = entity.components.EnergyConsumer;
if (energyConsumerComp) {
// Check if we have enough energy