Fixes the bubble shield integrated circuit (#23001)

The power draw of the bubble shield integrated circuit wasn't being
updated when the shields were removed, so I fixed that.
This commit is contained in:
Casper3667
2026-08-06 09:33:02 +00:00
committed by GitHub
parent 0f518d6563
commit 5cbd7aeb7b
2 changed files with 13 additions and 2 deletions
@@ -610,6 +610,7 @@
LAZYREMOVE(deployed_shields, shield)
qdel(shield)
set_pin_data(IC_OUTPUT, 1, LAZYLEN(deployed_shields))
update_power_draw()
/obj/item/integrated_circuit/manipulation/bubble_shield/do_work()
if(!assembly)
@@ -652,13 +653,17 @@
set_pin_data(IC_OUTPUT, 1, LAZYLEN(deployed_shields))
activate_pin(2)
update_power_draw()
..()
/obj/item/integrated_circuit/manipulation/bubble_shield/proc/update_power_draw()
var/strength = between(10, get_pin_data(IC_INPUT, 3), 50)
if(deployed_shields)
power_draw_idle = power_draw_per_use * (strength / 10) * LAZYLEN(deployed_shields)
else
power_draw_idle = 0
..()
/obj/item/integrated_circuit/manipulation/bubble_shield/power_fail()
for(var/obj/structure/machinery/shield/shield in deployed_shields)
kill_shield(shield)