This commit is contained in:
Poojawa
2018-09-11 02:49:41 -05:00
parent 09512a6001
commit b6430559e9
104 changed files with 1522 additions and 765 deletions
+15 -5
View File
@@ -2,7 +2,9 @@
var/gc_destroyed //Time when this object was destroyed.
var/list/active_timers //for SStimer
var/list/datum_components //for /datum/components
var/list/comp_lookup //for /datum/components
var/list/comp_lookup //it used to be for looking up components which had registered a signal but now anything can register
var/list/signal_procs
var/signal_enabled = FALSE
var/datum_flags = NONE
var/datum/weakref/weak_reference
@@ -20,6 +22,7 @@
// Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE.
/datum/proc/Destroy(force=FALSE, ...)
tag = null
datum_flags &= ~DF_USE_TAG //In case something tries to REF us
weak_reference = null //ensure prompt GCing of weakref.
var/list/timers = active_timers
@@ -30,6 +33,9 @@
continue
qdel(timer)
//BEGIN: ECS SHIT
signal_enabled = FALSE
var/list/dc = datum_components
if(dc)
var/all_components = dc[/datum/component]
@@ -55,6 +61,10 @@
comp.UnregisterSignal(src, sig)
comp_lookup = lookup = null
for(var/target in signal_procs)
UnregisterSignal(target, signal_procs[target])
//END: ECS SHIT
return QDEL_HINT_QUEUE
#ifdef DATUMVAR_DEBUGGING_MODE
@@ -86,16 +96,16 @@
//Return a LIST for serialize_datum to encode! Not the actual json!
/datum/proc/serialize_list(list/options)
return NOT_IMPLEMENTED
CRASH("Attempted to serialize datum [src] of type [type] without serialize_list being implemented!")
//Accepts a LIST from deserialize_datum. Should return src or another datum.
/datum/proc/deserialize_list(json, list/options)
return NOT_IMPLEMENTED
CRASH("Attempted to deserialize datum [src] of type [type] without deserialize_list being implemented!")
//Serializes into JSON. Does not encode type.
/datum/proc/serialize_json(list/options)
. = serialize_list(options)
if((. == NOT_IMPLEMENTED) || !islist(.))
if(!islist(.))
. = null
else
. = json_encode(.)
@@ -146,4 +156,4 @@
if(!istype(returned, /datum))
qdel(D)
else
return returned
return returned