SMES units now accept charge even if the available input is less than the input rate. (#969)
This commit is contained in:
committed by
kevinz000
parent
fde364e82f
commit
b7adb8cd93
@@ -256,9 +256,9 @@
|
||||
input_available = terminal.surplus()
|
||||
|
||||
if(inputting)
|
||||
if(input_available > 0 && input_available >= input_level) // if there's power available, try to charge
|
||||
if(input_available > 0) // if there's power available, try to charge
|
||||
|
||||
var/load = min((capacity-charge)/SMESRATE, input_level) // charge at set rate, limited to spare capacity
|
||||
var/load = min(min((capacity-charge)/SMESRATE, input_level), input_available) // charge at set rate, limited to spare capacity
|
||||
|
||||
charge += load * SMESRATE // increase the charge
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
inputting = 0 // stop inputting
|
||||
|
||||
else
|
||||
if(input_attempt && input_available > 0 && input_available >= input_level)
|
||||
if(input_attempt && input_available > 0)
|
||||
inputting = 1
|
||||
else
|
||||
inputting = 0
|
||||
|
||||
Reference in New Issue
Block a user