Fix quantum batteries eating overflown power
if someone edited save files
This commit is contained in:
parent
0eb24460e4
commit
abd52a64b1
@ -107,7 +107,11 @@ class QuantumBatteryItem : Item {
|
||||
return howMuch
|
||||
}
|
||||
|
||||
val newEnergy = (delegate.value + howMuch.coerceAtMost(throughput!!)).coerceAtMost(capacity!!)
|
||||
if (delegate.value >= capacity!!) {
|
||||
return ImpreciseFraction.ZERO
|
||||
}
|
||||
|
||||
val newEnergy = (delegate.value + howMuch.coerceAtMost(throughput!!)).coerceAtMost(capacity)
|
||||
val diff = newEnergy - delegate.value
|
||||
|
||||
if (!simulate) {
|
||||
|
Loading…
Reference in New Issue
Block a user