mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
* This is PHASE 1 of a multi-phase conversion. In this first phase we implement the subsystem, but leave it processing the existing global list variables. In the next phase we will switch to use datum variables in the subsystem. The main reason for splitting into two phases is ease of code review; change the meaningful code without the hundreds of machines -> SSmachines.machinery substitutions. * We did declare macros for adding/removing things to the processing lists, and convert everywhere to use the macros. * Added var/is_processing to /datum to keep track of whether an instance is already in a processing list (prevents it being in the list twice!) and also debugging, making sure its not in two lists etc. * NOTE: The global machines list is **no longer sorted** for performance reasons. As far as I know, the only module that actually ever cared was cameras. Our camera system already handles its own sorting in the cameranets anyway, so it should no longer be needed.
24 lines
840 B
Plaintext
24 lines
840 B
Plaintext
//
|
|
// datum defines!
|
|
// Note: Adding vars to /datum adds a var to EVERYTHING! Don't go overboard.
|
|
//
|
|
|
|
/datum
|
|
var/gc_destroyed //Time when this object was destroyed.
|
|
var/weakref/weakref // Holder of weakref instance pointing to this datum
|
|
var/is_processing = FALSE // If this datum is in an MC processing list, this will be set to its name.
|
|
|
|
#ifdef TESTING
|
|
var/tmp/running_find_references
|
|
var/tmp/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)
|
|
weakref = null // Clear this reference to ensure it's kept for as brief duration as possible.
|
|
tag = null
|
|
nanomanager.close_uis(src)
|
|
return QDEL_HINT_QUEUE
|