Remove free power
This commit is contained in:
@@ -47,6 +47,9 @@ public class PowerDiode extends Block{
|
|||||||
// limit offering to space available
|
// limit offering to space available
|
||||||
send = Mathf.clamp(send, 0f, frontGraph.getTotalBatteryCapacity() - frontGraph.getBatteryStored());
|
send = Mathf.clamp(send, 0f, frontGraph.getTotalBatteryCapacity() - frontGraph.getBatteryStored());
|
||||||
|
|
||||||
|
// limit to sendable power
|
||||||
|
send = Mathf.clamp(send, 0f, backGraph.getBatteryStored());
|
||||||
|
|
||||||
if (send == 0f) return;
|
if (send == 0f) return;
|
||||||
backGraph.useBatteries(send);
|
backGraph.useBatteries(send);
|
||||||
frontGraph.chargeBatteries(send);
|
frontGraph.chargeBatteries(send);
|
||||||
|
|||||||
Reference in New Issue
Block a user