Initialize Refactor (#25981)

Shouldn't break anything, stops warning spam, logs errors qdel style at the end of the game.

Initialize now expects a hint to be returned, one of:
INITIALIZE_HINT_NORMAL - Does nothing, returned by the root proc
INITIALIZE_HINT_LATELOAD - Call atom/proc/LateInitialize
INITIALIZE_HINT_QDEL - Calls qdel on the atom

LateInitialize currently defaults to the old re-calling behavior so there should be no issues with that.
Things that didn't return a hint or fucked up somehow will be logged less loudly than they were before

No more world start warnings!
This commit is contained in:
Cyberboss
2017-04-27 09:02:29 +12:00
committed by oranges
parent 1eaacae14a
commit 5ace376e4a
21 changed files with 226 additions and 145 deletions
+5 -8
View File
@@ -22,20 +22,17 @@
var/perma_docked = FALSE //highlander with RESPAWN??? OH GOD!!!
/obj/docking_port/mobile/arrivals/Initialize(mapload)
if(mapload)
return TRUE //late initialize to make sure the latejoin list is populated
preferred_direction = dir
if(SSshuttle.arrivals)
WARNING("More than one arrivals docking_port placed on map!")
qdel(src)
return
return INITIALIZE_HINT_QDEL
SSshuttle.arrivals = src
. = ..()
preferred_direction = dir
return INITIALIZE_HINT_LATELOAD //for latejoin list
/obj/docking_port/mobile/arrivals/LateInitialize()
areas = list()
var/list/new_latejoin = list()