mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #6854 from mwerezak/shieldgen
Fixes emergency shield generators running with no power.
This commit is contained in:
@@ -160,8 +160,7 @@
|
|||||||
idle_power_usage = 0
|
idle_power_usage = 0
|
||||||
|
|
||||||
/obj/machinery/shieldgen/Del()
|
/obj/machinery/shieldgen/Del()
|
||||||
for(var/obj/machinery/shield/shield_tile in deployed_shields)
|
collapse_shields()
|
||||||
del(shield_tile)
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
|
||||||
@@ -184,8 +183,7 @@
|
|||||||
src.active = 0
|
src.active = 0
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
for(var/obj/machinery/shield/shield_tile in deployed_shields)
|
collapse_shields()
|
||||||
del(shield_tile)
|
|
||||||
|
|
||||||
update_use_power(0)
|
update_use_power(0)
|
||||||
|
|
||||||
@@ -197,8 +195,20 @@
|
|||||||
deployed_shields += S
|
deployed_shields += S
|
||||||
use_power(S.shield_generate_power)
|
use_power(S.shield_generate_power)
|
||||||
|
|
||||||
|
/obj/machinery/shieldgen/proc/collapse_shields()
|
||||||
|
for(var/obj/machinery/shield/shield_tile in deployed_shields)
|
||||||
|
del(shield_tile)
|
||||||
|
|
||||||
|
/obj/machinery/shieldgen/power_change()
|
||||||
|
..()
|
||||||
|
if (stat & NOPOWER)
|
||||||
|
collapse_shields()
|
||||||
|
else
|
||||||
|
create_shields()
|
||||||
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/shieldgen/process()
|
/obj/machinery/shieldgen/process()
|
||||||
if (!active)
|
if (!active || (stat & NOPOWER))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(malfunction)
|
if(malfunction)
|
||||||
@@ -224,6 +234,8 @@
|
|||||||
if(health <= 30)
|
if(health <= 30)
|
||||||
src.malfunction = 1
|
src.malfunction = 1
|
||||||
if(health <= 0)
|
if(health <= 0)
|
||||||
|
spawn(0)
|
||||||
|
explosion(get_turf(src.loc), 0, 0, 1, 0, 0, 0)
|
||||||
del(src)
|
del(src)
|
||||||
update_icon()
|
update_icon()
|
||||||
return
|
return
|
||||||
@@ -340,7 +352,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/obj/machinery/shieldgen/update_icon()
|
/obj/machinery/shieldgen/update_icon()
|
||||||
if(active)
|
if(active && !(stat & NOPOWER))
|
||||||
src.icon_state = malfunction ? "shieldonbr":"shieldon"
|
src.icon_state = malfunction ? "shieldonbr":"shieldon"
|
||||||
else
|
else
|
||||||
src.icon_state = malfunction ? "shieldoffbr":"shieldoff"
|
src.icon_state = malfunction ? "shieldoffbr":"shieldoff"
|
||||||
|
|||||||
Reference in New Issue
Block a user