mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Fix more Destroy / GC issues.
Fixes recursive Destroy call on containment field. Fix unable to GC issue on air alarms. Fix unable to GC issue on radiation sources.
This commit is contained in:
@@ -18,7 +18,7 @@ var/global/repository/radiation/radiation_repository = new()
|
||||
/datum/radiation_source/Destroy()
|
||||
radiation_repository.sources -= src
|
||||
if(radiation_repository.sources_assoc[src.source_turf] == src)
|
||||
radiation_repository.sources -= src.source_turf
|
||||
radiation_repository.sources_assoc -= src.source_turf
|
||||
src.source_turf = null
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -103,6 +103,9 @@
|
||||
unregister_radio(src, frequency)
|
||||
qdel(wires)
|
||||
wires = null
|
||||
if(alarm_area && alarm_area.master_air_alarm == src)
|
||||
alarm_area.master_air_alarm = null
|
||||
elect_master(exclude_self = TRUE)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/alarm/New()
|
||||
@@ -271,8 +274,10 @@
|
||||
/obj/machinery/alarm/proc/master_is_operating()
|
||||
return alarm_area && alarm_area.master_air_alarm && !(alarm_area.master_air_alarm.stat & (NOPOWER | BROKEN))
|
||||
|
||||
/obj/machinery/alarm/proc/elect_master()
|
||||
/obj/machinery/alarm/proc/elect_master(exclude_self = FALSE)
|
||||
for(var/obj/machinery/alarm/AA in alarm_area)
|
||||
if(exclude_self && AA == src)
|
||||
continue
|
||||
if(!(AA.stat & (NOPOWER|BROKEN)))
|
||||
alarm_area.master_air_alarm = AA
|
||||
return 1
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
FG1.cleanup()
|
||||
if(FG2 && !FG2.clean_up)
|
||||
FG2.cleanup()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/containment_field/attack_hand(mob/user as mob)
|
||||
if(get_dist(src, user) > 1)
|
||||
|
||||
@@ -168,7 +168,7 @@ field_generator power level display
|
||||
|
||||
/obj/machinery/field_generator/Destroy()
|
||||
src.cleanup()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
|
||||
|
||||
@@ -312,12 +312,12 @@ field_generator power level display
|
||||
/obj/machinery/field_generator/proc/cleanup()
|
||||
clean_up = 1
|
||||
for (var/obj/machinery/containment_field/F in fields)
|
||||
if (isnull(F))
|
||||
if (QDELETED(F))
|
||||
continue
|
||||
qdel(F)
|
||||
fields = list()
|
||||
for(var/obj/machinery/field_generator/FG in connected_gens)
|
||||
if (isnull(FG))
|
||||
if (QDELETED(FG))
|
||||
continue
|
||||
FG.connected_gens.Remove(src)
|
||||
if(!FG.clean_up)//Makes the other gens clean up as well
|
||||
|
||||
Reference in New Issue
Block a user