From 099f594a307c9236f4c1f9ecc81c740aaa605706 Mon Sep 17 00:00:00 2001 From: Detective Google <48196179+Detective-Google@users.noreply.github.com> Date: Mon, 22 Jun 2020 15:56:51 -0500 Subject: [PATCH] SMESes should now work with self-charging cells (tg#51240) --- code/modules/power/smes.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 85999707a2..788b4b1441 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -228,6 +228,11 @@ var/last_chrg = inputting var/last_onln = outputting + //check for self-recharging cells in stock parts and use them to self-charge + for(var/obj/item/stock_parts/cell/C in component_parts) + if(C.self_recharge) + charge += min(capacity-charge, C.chargerate) // If capacity-charge is smaller than the attempted charge rate, this avoids overcharging + //inputting if(terminal && input_attempt) input_available = terminal.surplus()