fixes up a tiiny cell charge oversight

This commit is contained in:
DeltaFire
2020-11-24 19:43:14 +01:00
parent adc2af2dde
commit ac20bb7d8c
+1 -1
View File
@@ -1373,7 +1373,7 @@
// next: take from or charge to the cell, depending on how much is left
if(cell && !shorted)
if(cur_excess > 0)
var/charging_cell = min(cur_excess*GLOB.CELLRATE, cell.maxcharge * GLOB.CHARGELEVEL)
var/charging_cell = min(min(cur_excess*GLOB.CELLRATE, cell.maxcharge * GLOB.CHARGELEVEL), cell.maxcharge - cell.charge)
cell.give(charging_cell)
add_load(charging_cell/GLOB.CELLRATE)
lastused_total += charging_cell