Power Event should fire when power becomes available, even if the networks idle cost is 0.

This commit is contained in:
AlgorithmX2 2014-09-11 22:55:14 -05:00
parent 3329d9455b
commit c62f415648

View file

@ -384,8 +384,17 @@ public class EnergyGridCache implements IEnergyGrid
tickInjectionPerTick = 0;
// power information.
double drained = extractAEPower( getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG );
boolean currentlyHasPower = drained >= drainPerTick - 0.001;
boolean currentlyHasPower = false;
if ( drainPerTick > 0.0001 )
{
double drained = extractAEPower( getIdlePowerUsage(), Actionable.MODULATE, PowerMultiplier.CONFIG );
currentlyHasPower = drained >= drainPerTick - 0.001;
}
else
{
currentlyHasPower = extractAEPower( 0.1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0;
}
// ticks since change..
if ( currentlyHasPower == hasPower )