From a7765aed6fe0364aa848a361e6c5d84cd1145cb9 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Sun, 27 Jun 2021 07:39:32 -0700 Subject: [PATCH] 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. --- code/modules/power/apc.dm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index ccb841dec8..9a201b7d9c 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -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