Fixed accelerator injector ignoring local enabled state

This commit is contained in:
LemADEC 2022-03-06 19:02:36 +01:00
parent c652797c09
commit 8b97bc7a2c

View file

@ -239,7 +239,11 @@ public class TileEntityAcceleratorCore extends TileEntityAbstractEnergyCoreOrCon
injectionTicks = injectionPeriodTicks;
final int countInjectors = acceleratorSetup.keyInjectors.length;
if (indexNextInjector < countInjectors) {
onInject(acceleratorSetup.mapInjectors.get(acceleratorSetup.keyInjectors[indexNextInjector]));
final Integer controlChannel = acceleratorSetup.keyInjectors[indexNextInjector];
final AcceleratorControlParameter acceleratorControlParameter = mapControlParameters.get(controlChannel);
if (acceleratorControlParameter == null || acceleratorControlParameter.isEnabled) {
onInject(acceleratorSetup.mapInjectors.get(controlChannel));
}
} else {
// invalid setup => force a reset
rebootAccelerator(acceleratorSetup,false, true);