mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-18 18:46:24 +01:00
Weakref cleanup (#19382)
* oh god help * fixes * oops * container runtime --------- Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user