Unify datum definitions (#3991)

Unifies all datum vars into a single file & moves all datum procs that made sense into that same file.
This commit is contained in:
Lohikar
2017-12-23 13:29:17 -06:00
committed by Erki
parent 855562c7c2
commit 38a3dc55aa
6 changed files with 28 additions and 30 deletions

27
code/datums/datum.dm Normal file
View File

@@ -0,0 +1,27 @@
/datum
var/tmp/list/active_timers
var/tmp/datum/weakref/weakref
var/tmp/isprocessing = 0
var/tmp/gcDestroyed //Time when this object was destroyed.
// 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)
weakref = null
destroyed_event.raise_event(src)
SSnanoui.close_uis(src)
tag = null
var/list/timers = active_timers
active_timers = null
if (timers)
for (var/thing in timers)
var/datum/timedevent/timer = thing
if (timer.spent)
continue
qdel(timer)
return QDEL_HINT_QUEUE
/datum/proc/process()
return PROCESS_KILL

View File

@@ -1,10 +1,6 @@
/datum
var/datum/weakref/weakref
/datum/weakref
var/ref
/datum/weakref/New(datum/D)
ref = SOFTREF(D)