diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 67846d019d..55132cba28 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -234,33 +234,7 @@ SUBSYSTEM_DEF(garbage) else if(D.gc_destroyed == GC_CURRENTLY_BEING_QDELETED) CRASH("[D.type] destroy proc was called multiple times, likely due to a qdel loop in the Destroy logic") -// Default implementation of clean-up code. -// This should be overridden to remove all references pointing to the object being destroyed. -// Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE. -// TODO: Move this and all datum var definitions into code/datums/datum.dm -/datum/proc/Destroy(force=FALSE) - tag = null - var/list/timers = active_timers - active_timers = null - for(var/thing in timers) - var/datum/timedevent/timer = thing - if (timer.spent) - continue - qdel(timer) - var/list/dc = datum_components - for(var/I in dc) - var/datum/component/C = I - C._RemoveNoSignal() - qdel(C) - if(dc) - dc.Cut() - return QDEL_HINT_QUEUE - -/datum/var/gc_destroyed //Time when this object was destroyed. - #ifdef TESTING -/datum/var/running_find_references -/datum/var/last_find_references = 0 /datum/verb/find_refs() set category = "Debug" diff --git a/code/controllers/subsystem/timer.dm b/code/controllers/subsystem/timer.dm index 5696fa09e7..daf0eb324d 100644 --- a/code/controllers/subsystem/timer.dm +++ b/code/controllers/subsystem/timer.dm @@ -210,7 +210,6 @@ SUBSYSTEM_DEF(timer) timer_id_dict |= SStimer.timer_id_dict bucket_list |= SStimer.bucket_list -/datum/var/list/active_timers /datum/timedevent var/id var/datum/callback/callBack diff --git a/code/datums/components/component.dm b/code/datums/components/component.dm index 6af3039217..20e2a6e9ac 100644 --- a/code/datums/components/component.dm +++ b/code/datums/components/component.dm @@ -66,8 +66,6 @@ /datum/component/proc/OnTransfer(datum/new_parent) return -/datum/var/list/datum_components //list of /datum/component - /datum/proc/SendSignal(sigtype, ...) var/list/comps = datum_components . = FALSE diff --git a/code/datums/datum.dm b/code/datums/datum.dm new file mode 100644 index 0000000000..3bedbe87cf --- /dev/null +++ b/code/datums/datum.dm @@ -0,0 +1,31 @@ +/datum + var/gc_destroyed //Time when this object was destroyed. + var/list/active_timers //for SStimer + var/list/datum_components //for /datum/components + var/ui_screen = "home" //for tgui + +#ifdef TESTING + var/running_find_references + var/last_find_references = 0 +#endif + +// Default implementation of clean-up code. +// This should be overridden to remove all references pointing to the object being destroyed. +// Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE. +/datum/proc/Destroy(force=FALSE) + tag = null + var/list/timers = active_timers + active_timers = null + for(var/thing in timers) + var/datum/timedevent/timer = thing + if (timer.spent) + continue + qdel(timer) + var/list/dc = datum_components + for(var/I in dc) + var/datum/component/C = I + C._RemoveNoSignal() + qdel(C) + if(dc) + dc.Cut() + return QDEL_HINT_QUEUE \ No newline at end of file diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm index a45b4a7daf..2d75ebab6a 100644 --- a/code/modules/tgui/external.dm +++ b/code/modules/tgui/external.dm @@ -60,13 +60,6 @@ /datum/proc/ui_host() return src // Default src. - /** - * global - * - * Used to track the current screen. - **/ -/datum/var/ui_screen = "home" - /** * global * diff --git a/tgstation.dme b/tgstation.dme index 8fc6e297d5..9e09f17fdb 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -247,6 +247,7 @@ #include "code\datums\browser.dm" #include "code\datums\callback.dm" #include "code\datums\datacore.dm" +#include "code\datums\datum.dm" #include "code\datums\datumvars.dm" #include "code\datums\dna.dm" #include "code\datums\dog_fashion.dm"