Fixed com. gen. crash

This commit is contained in:
CrazyPants committed 2014-06-17 14:25:37 +08:00
1 parent a4bfc60b7d
commit 0d7d60a19a
1 file changed
+5 -2
@@ -210,8 +210,11 @@ public class TileCombustionGenerator extends AbstractMachineEntity implements IP
//once full, don't start again until we have drained 10 seconds worth of power to prevent
//flickering on and off constantly when powering a machine that draws less than this produces
if(inPause && storedEnergy >= (powerHandler.getMaxEnergyStored() - (curFuel.powerPerCycle * 200))) {
return false;
if(inPause) {
double powerPerCycle = curFuel == null ? 0 : curFuel.powerPerCycle;
if(storedEnergy >= (powerHandler.getMaxEnergyStored() - (powerPerCycle * 200))) {
return false;
}
}
inPause = false;