diff --git a/code/datums/datum.dm b/code/datums/datum.dm index 3361229b92e..a4169004fc9 100644 --- a/code/datums/datum.dm +++ b/code/datums/datum.dm @@ -111,9 +111,6 @@ tag = null datum_flags &= ~DF_USE_TAG //In case something tries to REF us weak_reference = null //ensure prompt GCing of weakref. - if(!(datum_flags & DF_STATIC_OBJECT)) - DREAMLUAU_CLEAR_REF_USERDATA(vars) // vars ceases existing when src does, so we need to clear any lua refs to it that exist. - DREAMLUAU_CLEAR_REF_USERDATA(src) if(_active_timers) var/list/timers = _active_timers @@ -145,6 +142,10 @@ _clear_signal_refs() //END: ECS SHIT + if(!(datum_flags & DF_STATIC_OBJECT)) + DREAMLUAU_CLEAR_REF_USERDATA(vars) // vars ceases existing when src does, so we need to clear any lua refs to it that exist. + DREAMLUAU_CLEAR_REF_USERDATA(src) + return QDEL_HINT_QUEUE ///Only override this if you know what you're doing. You do not know what you're doing