From 6d7a2f7fc3fac2fa954c5e57be8c3c44b3956b2d Mon Sep 17 00:00:00 2001 From: Elizabeth Lavenza Date: Sat, 13 Apr 2024 19:14:59 -0400 Subject: [PATCH] Fix battery cell icons --- code/modules/modular_computers/hardware/battery_module.dm | 1 + code/modules/power/cell.dm | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/modular_computers/hardware/battery_module.dm b/code/modules/modular_computers/hardware/battery_module.dm index 27d3546ca2..1f2f884bf4 100644 --- a/code/modules/modular_computers/hardware/battery_module.dm +++ b/code/modules/modular_computers/hardware/battery_module.dm @@ -69,6 +69,7 @@ icon_state = "cell_mini" w_class = WEIGHT_CLASS_TINY maxcharge = 750 + has_charge_overlay = FALSE /obj/item/stock_parts/cell/computer/advanced name = "advanced battery" diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index bf8899e5d5..f3587c01b3 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -22,6 +22,8 @@ var/ratingdesc = TRUE ///If it's a grown that acts as a battery, add a wire overlay to it. var/grown_battery = FALSE + /// If true, add the o1 and o2 overlays based on charge level. + var/has_charge_overlay = TRUE rad_flags = RAD_NO_CONTAMINATE // Prevent the same cheese as with the stock parts /obj/item/stock_parts/cell/get_cell() @@ -64,7 +66,7 @@ if(grown_battery) . += image('icons/obj/power.dmi', "grown_wires") return - if(charge < 0.01) + if(!has_charge_overlay || charge < 0.01) return else if(charge/maxcharge >=0.995) . += "cell-o2"