Weakref cleanup (#19382)

* oh god help

* fixes

* oops

* container runtime

---------

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
Will
2026-04-21 04:57:02 -04:00
committed by GitHub
parent 47a0e04bae
commit fb4cf2e80a
34 changed files with 107 additions and 9 deletions
+4
View File
@@ -72,6 +72,10 @@
origin = WEAKREF(holder)
..()
/datum/modifier/Destroy(force)
. = ..()
origin = null
// Checks if the modifier should be allowed to be applied to the mob before attaching it.
// Override for special criteria, e.g. forbidding robots from receiving it.
/datum/modifier/proc/can_apply(var/mob/living/L, var/suppress_output = FALSE)
+6
View File
@@ -64,6 +64,12 @@
update_icons() //VOREstation edit - overlay runtime fix
default_language = GLOB.all_languages[LANGUAGE_GALCOM] //VOREstation edit - runtime fix
/mob/living/bot/Destroy()
. = ..()
ignore_list.Cut()
patrol_path.Cut()
target_path.Cut()
/mob/living/bot/Life()
..()
if(health <= 0)
+8 -6
View File
@@ -39,12 +39,14 @@
if(spray_blood && prob(5)) // Make a big mess
visible_message("Something flies out of [src]. It seems to be acting oddly.")
var/obj/effect/decal/cleanable/blood/gibs/gib = new /obj/effect/decal/cleanable/blood/gibs(loc)
// TODO - I have a feeling weakrefs will not work in ignore_list, verify this ~Leshana
var/datum/weakref/g = WEAKREF(gib)
ignore_list += g
spawn(600)
ignore_list -= g
var/obj/effect/decal/cleanable/blood/gibs/gib = new /obj/effect/decal/cleanable/blood/gibs(get_turf(src))
ignore_list += gib
addtimer(CALLBACK(src,PROC_REF(clear_ignored_gib), gib), 1 MINUTE, TIMER_DELETE_ME)
/mob/living/bot/cleanbot/proc/clear_ignored_gib(var/obj/gibref)
SHOULD_NOT_OVERRIDE(TRUE)
PRIVATE_PROC(TRUE)
ignore_list -= gibref
/mob/living/bot/cleanbot/handlePanic() // Speed modification based on alert level.
. = 0