Remove free power

This commit is contained in:
Patrick 'Quezler' Mounier
2019-10-31 20:01:33 +01:00
parent c877f6e04f
commit 4c5e30dbcc

View File

@@ -47,6 +47,9 @@ public class PowerDiode extends Block{
// limit offering to space available
send = Mathf.clamp(send, 0f, frontGraph.getTotalBatteryCapacity() - frontGraph.getBatteryStored());
// limit to sendable power
send = Mathf.clamp(send, 0f, backGraph.getBatteryStored());
if (send == 0f) return;
backGraph.useBatteries(send);
frontGraph.chargeBatteries(send);