Shield diffusers gets disabled with meteors (#8123)

This commit is contained in:
Guti
2024-04-02 12:22:43 +02:00
committed by GitHub
parent 943edd8788
commit 1c357d32e9
2 changed files with 17 additions and 0 deletions

View File

@@ -85,6 +85,8 @@
if(!duration)
return
alarm = round(max(alarm, duration))
for(var/obj/machinery/shield_gen/gen in global.machines) // CHOMPEdit - Fills the gaps made by diffusers
gen.fill_diffused()
update_icon()
/obj/machinery/shield_diffuser/examine(var/mob/user)

View File

@@ -258,6 +258,21 @@
for(var/mob/M in view(5,src))
to_chat(M, "[icon2html(src, M.client)] You hear heavy droning fade out.")
shield_hum.stop()
// CHOMPAdd Start - Fills gaps when meteors happen
/obj/machinery/shield_gen/proc/fill_diffused()
if(active)
var/list/covered_turfs = get_shielded_turfs()
var/turf/T = get_turf(src)
var/obj/effect/energy_field/E
if(T in covered_turfs)
covered_turfs.Remove(T)
for(var/turf/O in covered_turfs)
if(locate(/obj/effect/energy_field, O))
continue
E = new(O, src)
field.Add(E)
covered_turfs = null
// CHOMPAdd End
/obj/machinery/shield_gen/update_icon()
if(stat & BROKEN)