sheeesh
This commit is contained in:
parent
f5840c4ca1
commit
7c4ad1049e
@ -37,7 +37,7 @@ internal fun IEnergyStorage.receiveEnergy(amount: Decimal, simulate: Boolean): D
|
||||
if (this is IMatteryEnergyStorage)
|
||||
return receiveEnergyChecked(amount, simulate)
|
||||
|
||||
if (!amount.isPositive)
|
||||
if (amount.isNegative)
|
||||
throw IllegalArgumentException("Negative energy: $amount")
|
||||
|
||||
if (!canReceive())
|
||||
@ -56,7 +56,7 @@ internal fun IEnergyStorage.extractEnergy(amount: Decimal, simulate: Boolean): D
|
||||
if (this is IMatteryEnergyStorage)
|
||||
return extractEnergyChecked(amount, simulate)
|
||||
|
||||
if (!amount.isPositive)
|
||||
if (amount.isNegative)
|
||||
throw IllegalArgumentException("Negative energy: $amount")
|
||||
|
||||
if (!canExtract())
|
||||
|
Loading…
Reference in New Issue
Block a user