Fixes shoddy math & assumptions causing APCs in sufficiently high-power-requiring rooms to work forever (#14896)

* Fixes shoddy math & assumptions causing bad

* i typed it. i know it did.
This commit is contained in:
Putnam3145
2021-06-27 07:39:32 -07:00
committed by GitHub
parent bfcefc75fa
commit a7765aed6f
+1 -7
View File
@@ -1389,13 +1389,7 @@
charging = APC_NOT_CHARGING
chargecount = 0
longtermpower = max(-10,longtermpower - 2)
if(cell.charge >= cur_used)
cell.use(GLOB.CELLRATE * cur_used)
else
// This turns everything off in the case that there is still a charge left on the battery, just not enough to run the room.
equipment = autoset(equipment, 0)
lighting = autoset(lighting, 0)
environ = autoset(environ, 0)
cell.use(min(GLOB.CELLRATE * cur_used, cell.charge))
// set channels based on remaining charge