Fix the network fix (doEmit was always being called with tryAgain false).

This commit is contained in:
Ben Spiers 2014-08-19 16:42:16 +01:00
parent a8993cb223
commit 6316ec5fd5

View file

@ -139,17 +139,15 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
double sent = 0;
boolean tryAgain = false;
int i = 0;
do {
tryAgain = false;
double prev = sent;
sent += doEmit(energyToSend-sent, tryAgain);
if(energyToSend-sent > 0 && sent-prev > 0)
{
tryAgain = true;
}
tryAgain = energyToSend-sent > 0 && sent-prev > 0 && i < 100;
i++;
} while(tryAgain);
joulesTransmitted = sent;