diff --git a/code/__DEFINES/atom_states.dm b/code/__DEFINES/atom_states.dm new file mode 100644 index 00000000000..91484f9a51f --- /dev/null +++ b/code/__DEFINES/atom_states.dm @@ -0,0 +1,4 @@ +#define BAD_INIT_QDEL_BEFORE (1<<0) +#define BAD_INIT_DIDNT_INIT (1<<1) +#define BAD_INIT_SLEPT (1<<2) +#define BAD_INIT_NO_HINT (1<<3) diff --git a/code/controllers/subsystem/non_firing/SSatoms.dm b/code/controllers/subsystem/non_firing/SSatoms.dm index a1c515fdb80..038f417c9b0 100644 --- a/code/controllers/subsystem/non_firing/SSatoms.dm +++ b/code/controllers/subsystem/non_firing/SSatoms.dm @@ -1,8 +1,3 @@ -#define BAD_INIT_QDEL_BEFORE (1<<0) -#define BAD_INIT_DIDNT_INIT (1<<1) -#define BAD_INIT_SLEPT (1<<2) -#define BAD_INIT_NO_HINT (1<<3) - SUBSYSTEM_DEF(atoms) name = "Atoms" init_order = INIT_ORDER_ATOMS @@ -123,7 +118,25 @@ SUBSYSTEM_DEF(atoms) old_initialized = SSatoms.old_initialized BadInitializeCalls = SSatoms.BadInitializeCalls -#undef BAD_INIT_QDEL_BEFORE -#undef BAD_INIT_DIDNT_INIT -#undef BAD_INIT_SLEPT -#undef BAD_INIT_NO_HINT + + +/client/proc/debug_atom_init() + set name = "Atom Init Log" + set category = "Debug" + set desc = "Shows what failed to init this round" + + if(!check_rights(R_DEBUG | R_VIEWRUNTIMES)) + return + + var/list/html_data = list() + html_data += "

Bad Initialize() Calls

" + + for(var/typepath in SSatoms.BadInitializeCalls) + var/val = SSatoms.BadInitializeCalls[typepath] + + html_data += "" + + html_data += "
TypeQdeleted before initDid not initSlept during initNo init hint
[typepath][val & BAD_INIT_QDEL_BEFORE ? "X" : " "][val & BAD_INIT_DIDNT_INIT ? "X" : " "][val & BAD_INIT_SLEPT ? "X" : " "][val & BAD_INIT_NO_HINT ? "X" : " "]
" + + usr << browse(html_data.Join(), "window=initdebug") + diff --git a/code/controllers/subsystem/non_firing/SSlate_mapping.dm b/code/controllers/subsystem/non_firing/SSlate_mapping.dm index 9d48af77cfa..ca68dc48e9f 100644 --- a/code/controllers/subsystem/non_firing/SSlate_mapping.dm +++ b/code/controllers/subsystem/non_firing/SSlate_mapping.dm @@ -8,10 +8,32 @@ SUBSYSTEM_DEF(late_mapping) flags = SS_NO_FIRE /// List of all maze generators to process var/list/obj/effect/mazegen/generator/maze_generators = list() + /// List of all bridge spawners to process + var/list/obj/effect/spawner/bridge/bridge_spawners = list() /datum/controller/subsystem/late_mapping/Initialize() if(length(maze_generators)) + var/watch = start_watch() log_startup_progress("Generating mazes...") + for(var/i in maze_generators) var/obj/effect/mazegen/generator/MG = i MG.run_generator() + + var/list/mgcount = length(maze_generators) // Keeping track of this here because we wipe it next line down + QDEL_LIST_CONTENTS(maze_generators) + var/duration = stop_watch(watch) + log_startup_progress("Generated [mgcount] mazes in [duration]s") + + if(length(bridge_spawners)) + var/watch = start_watch() + log_startup_progress("Spawning bridges...") + + for(var/i in bridge_spawners) + var/obj/effect/spawner/bridge/BS = i + BS.generate_bridge() + + var/list/bscount = length(bridge_spawners) // Keeping track of this here because we wipe it next line down + QDEL_LIST_CONTENTS(bridge_spawners) + var/duration = stop_watch(watch) + log_startup_progress("Spawned [bscount] bridges in [duration]s") diff --git a/code/datums/ruins/bridges/bridges.dm b/code/datums/ruins/bridges/bridges.dm index 636a94adb18..6d5770419a3 100644 --- a/code/datums/ruins/bridges/bridges.dm +++ b/code/datums/ruins/bridges/bridges.dm @@ -62,7 +62,13 @@ /obj/effect/spawner/bridge/Initialize(mapload) . = ..() + SSlate_mapping.bridge_spawners += src +/obj/effect/spawner/bridge/Destroy() + SSlate_mapping.bridge_spawners -= src + return ..() + +/obj/effect/spawner/bridge/proc/generate_bridge() var/turf/east = locate(x + 3, y, z) var/turf/west = locate(x - 3, y, z) var/turf/north = locate(x, y + 3, z) @@ -79,4 +85,3 @@ else if((ismineralturf(north) || istype(north, /turf/simulated/floor/plating/asteroid)) && (ismineralturf(south) || istype(south, /turf/simulated/floor/plating/asteroid)) && !(ismineralturf(e1) || istype(e1, /turf/simulated/floor/plating/asteroid)) && !(ismineralturf(w1) || istype(w1, /turf/simulated/floor/plating/asteroid))) template = GLOB.bridge_vertical_templates[pick("lavaland_bridge_vertical_1.dmm", "lavaland_bridge_vertical_2.dmm", "lavaland_bridge_vertical_3.dmm", "lavaland_bridge_vertical_4.dmm", "lavaland_bridge_vertical_5.dmm", "lavaland_bridge_vertical_6.dmm")] template.load(loc, centered = TRUE) - qdel(src) //Don't turn to hint qdel, it won't work well at all sadly. diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 40f707866e0..4ab93649c91 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -62,8 +62,8 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/list/opened_positions = list() -/obj/machinery/computer/card/Initialize() - ..() +/obj/machinery/computer/card/Initialize(mapload) + . = ..() Radio = new /obj/item/radio(src) Radio.listening = FALSE Radio.config(list("Command" = 0)) diff --git a/code/game/machinery/computer/medical_records.dm b/code/game/machinery/computer/medical_records.dm index 1c9e8a78768..a57bc83ff48 100644 --- a/code/game/machinery/computer/medical_records.dm +++ b/code/game/machinery/computer/medical_records.dm @@ -28,7 +28,7 @@ light_color = LIGHT_COLOR_DARKBLUE /obj/machinery/computer/med_data/Initialize() - ..() + . = ..() field_edit_questions = list( // General "sex" = "Please select new sex:", diff --git a/code/game/machinery/dye_generator.dm b/code/game/machinery/dye_generator.dm index 3e7d346ec52..3a6e2c2c86f 100644 --- a/code/game/machinery/dye_generator.dm +++ b/code/game/machinery/dye_generator.dm @@ -9,7 +9,7 @@ var/dye_color = "#FFFFFF" /obj/machinery/dye_generator/Initialize() - ..() + . = ..() power_change() /obj/machinery/dye_generator/deconstruct(disassembled = TRUE) diff --git a/code/game/machinery/magnetic_module.dm b/code/game/machinery/magnetic_module.dm index f10aae48db5..5f50939ffd1 100644 --- a/code/game/machinery/magnetic_module.dm +++ b/code/game/machinery/magnetic_module.dm @@ -212,7 +212,6 @@ return INITIALIZE_HINT_LATELOAD /obj/machinery/magnetic_controller/LateInitialize() - ..() if(autolink) // GLOB.machines is populated in /machinery/Initialize // so linkage gets delayed until that one finished. diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index d675f29d405..0641f41f236 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -68,7 +68,7 @@ return ..() /obj/machinery/turretid/Initialize() - ..() + . = ..() if(!control_area) control_area = get_area(src) else if(istext(control_area)) diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index f07d0243c18..1dd7548fd4f 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -177,7 +177,7 @@ var/metal = MFOAM_ALUMINUM /obj/structure/foamedmetal/Initialize() - ..() + . = ..() air_update_turf(1) /obj/structure/foamedmetal/Destroy() diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 5118c56e628..eb19e9b1395 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -253,8 +253,8 @@ blocks_emissive = FALSE /obj/item/flashlight/flare/glowstick/Initialize() + . = ..() light_color = color - ..() /obj/item/flashlight/flare/glowstick/update_icon_state() if(!fuel) diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index dbb4ecb723a..518ec0bc614 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -26,8 +26,8 @@ ..() internal_channels.Cut() -/obj/item/radio/headset/Initialize() - ..() +/obj/item/radio/headset/Initialize(mapload) + . = ..() if(ks1type) keyslot1 = new ks1type(src) diff --git a/code/game/objects/items/devices/radio/radio_objects.dm b/code/game/objects/items/devices/radio/radio_objects.dm index d8476380c45..995889e743d 100644 --- a/code/game/objects/items/devices/radio/radio_objects.dm +++ b/code/game/objects/items/devices/radio/radio_objects.dm @@ -109,8 +109,8 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems) follow_target = null return ..() -/obj/item/radio/Initialize() - ..() +/obj/item/radio/Initialize(mapload) + . = ..() if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ) frequency = sanitize_frequency(frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ) set_frequency(frequency) diff --git a/code/game/objects/items/tools/welder.dm b/code/game/objects/items/tools/welder.dm index 239d13fd9a7..afb690efa6e 100644 --- a/code/game/objects/items/tools/welder.dm +++ b/code/game/objects/items/tools/welder.dm @@ -35,7 +35,7 @@ var/progress_flash_divisor = 10 //Length of time between each "eye flash" /obj/item/weldingtool/Initialize(mapload) - ..() + . = ..() create_reagents(maximum_fuel) reagents.add_reagent("fuel", maximum_fuel) update_icon() @@ -149,7 +149,7 @@ /obj/item/weldingtool/attack(mob/living/carbon/M, mob/living/carbon/user) // For lighting other people's cigarettes. var/obj/item/clothing/mask/cigarette/cig = M?.wear_mask - if(!istype(cig) || user.zone_selected != "mouth" || !tool_enabled) + if(!istype(cig) || user.zone_selected != "mouth" || !tool_enabled) return ..() if(M == user) diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index b2e1014bbb2..7958cd9dca8 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -20,8 +20,13 @@ var/value = 0 var/forcedmutation = FALSE //Will it give the mutation, guaranteed? -/obj/item/dnainjector/Initialize() +/obj/item/dnainjector/Initialize(mapload) . = ..() + + var/init_block = GetInitBlock() + if(init_block) + block = init_block + if(datatype && block) buf = new buf.dna = new @@ -29,6 +34,10 @@ buf.dna.ResetSE() SetValue(value) +// Override this with a var reference to do setup +/obj/item/dnainjector/proc/GetInitBlock() + return null + /obj/item/dnainjector/Destroy() QDEL_NULL(buf) return ..() @@ -157,9 +166,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/hulkmut/Initialize() - block = GLOB.hulkblock - ..() +/obj/item/dnainjector/hulkmut/GetInitBlock() + return GLOB.hulkblock /obj/item/dnainjector/antihulk name = "DNA-Injector (Anti-Hulk)" @@ -168,9 +176,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antihulk/Initialize() - block = GLOB.hulkblock - ..() +/obj/item/dnainjector/antihulk/GetInitBlock() + return GLOB.hulkblock /obj/item/dnainjector/firemut name = "DNA-Injector (Fire)" @@ -179,9 +186,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/firemut/Initialize() - block = GLOB.fireblock - ..() +/obj/item/dnainjector/firemut/GetInitBlock() + return GLOB.fireblock /obj/item/dnainjector/antifire name = "DNA-Injector (Anti-Fire)" @@ -190,9 +196,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antifire/Initialize() - block = GLOB.fireblock - ..() +/obj/item/dnainjector/antifire/GetInitBlock() + return GLOB.fireblock /obj/item/dnainjector/telemut name = "DNA-Injector (Tele.)" @@ -201,9 +206,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/telemut/Initialize() - block = GLOB.teleblock - ..() +/obj/item/dnainjector/telemut/GetInitBlock() + return GLOB.teleblock /obj/item/dnainjector/telemut/darkbundle name = "DNA injector" @@ -216,9 +220,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antitele/Initialize() - block = GLOB.teleblock - ..() +/obj/item/dnainjector/antitele/GetInitBlock() + return GLOB.teleblock /obj/item/dnainjector/nobreath name = "DNA-Injector (Breathless)" @@ -227,9 +230,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/nobreath/Initialize() - block = GLOB.breathlessblock - ..() +/obj/item/dnainjector/nobreath/GetInitBlock() + return GLOB.breathlessblock /obj/item/dnainjector/antinobreath name = "DNA-Injector (Anti-Breathless)" @@ -238,9 +240,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antinobreath/Initialize() - block = GLOB.breathlessblock - ..() +/obj/item/dnainjector/antinobreath/GetInitBlock() + return GLOB.breathlessblock /obj/item/dnainjector/remoteview name = "DNA-Injector (Remote View)" @@ -249,9 +250,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/remoteview/Initialize() - block = GLOB.remoteviewblock - ..() +/obj/item/dnainjector/remoteview/GetInitBlock() + return GLOB.remoteviewblock /obj/item/dnainjector/antiremoteview name = "DNA-Injector (Anti-Remote View)" @@ -260,9 +260,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antiremoteview/Initialize() - block = GLOB.remoteviewblock - ..() +/obj/item/dnainjector/antiremoteview/GetInitBlock() + return GLOB.remoteviewblock /obj/item/dnainjector/regenerate name = "DNA-Injector (Regeneration)" @@ -271,9 +270,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/regenerate/Initialize() - block = GLOB.regenerateblock - ..() +/obj/item/dnainjector/regenerate/GetInitBlock() + return GLOB.regenerateblock /obj/item/dnainjector/antiregenerate name = "DNA-Injector (Anti-Regeneration)" @@ -282,9 +280,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antiregenerate/Initialize() - block = GLOB.regenerateblock - ..() +/obj/item/dnainjector/antiregenerate/GetInitBlock() + return GLOB.regenerateblock /obj/item/dnainjector/morph name = "DNA-Injector (Morph)" @@ -293,9 +290,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/morph/Initialize() - block = GLOB.morphblock - ..() +/obj/item/dnainjector/morph/GetInitBlock() + return GLOB.morphblock /obj/item/dnainjector/antimorph name = "DNA-Injector (Anti-Morph)" @@ -304,9 +300,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antimorph/Initialize() - block = GLOB.morphblock - ..() +/obj/item/dnainjector/antimorph/GetInitBlock() + return GLOB.morphblock /obj/item/dnainjector/noprints name = "DNA-Injector (No Prints)" @@ -315,9 +310,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/noprints/Initialize() - block = GLOB.noprintsblock - ..() +/obj/item/dnainjector/noprints/GetInitBlock() + return GLOB.noprintsblock /obj/item/dnainjector/antinoprints name = "DNA-Injector (Anti-No Prints)" @@ -326,9 +320,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antinoprints/Initialize() - block = GLOB.noprintsblock - ..() +/obj/item/dnainjector/antinoprints/GetInitBlock() + return GLOB.noprintsblock /obj/item/dnainjector/insulation name = "DNA-Injector (Shock Immunity)" @@ -337,9 +330,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/insulation/Initialize() - block = GLOB.shockimmunityblock - ..() +/obj/item/dnainjector/insulation/GetInitBlock() + return GLOB.shockimmunityblock /obj/item/dnainjector/antiinsulation name = "DNA-Injector (Anti-Shock Immunity)" @@ -348,9 +340,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antiinsulation/Initialize() - block = GLOB.shockimmunityblock - ..() +/obj/item/dnainjector/antiinsulation/GetInitBlock() + return GLOB.shockimmunityblock /obj/item/dnainjector/midgit name = "DNA-Injector (Small Size)" @@ -359,9 +350,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/midgit/Initialize() - block = GLOB.smallsizeblock - ..() +/obj/item/dnainjector/midgit/GetInitBlock() + return GLOB.smallsizeblock /obj/item/dnainjector/antimidgit name = "DNA-Injector (Anti-Small Size)" @@ -370,9 +360,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antimidgit/Initialize() - block = GLOB.smallsizeblock - ..() +/obj/item/dnainjector/antimidgit/GetInitBlock() + return GLOB.smallsizeblock /obj/item/dnainjector/eatmut name = "DNA-Injector (Matter Eater)" @@ -381,9 +370,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/eatmut/Initialize() - block = GLOB.eatblock - return ..() +/obj/item/dnainjector/eatmut/GetInitBlock() + return GLOB.eatblock /obj/item/dnainjector/antieat name = "DNA-Injector (Anti-Matter Eater)" @@ -392,9 +380,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antieat/Initialize() - block = GLOB.eatblock - return ..() +/obj/item/dnainjector/antieat/GetInitBlock() + return GLOB.eatblock ///////////////////////////////////// /obj/item/dnainjector/antiglasses @@ -404,9 +391,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antiglasses/Initialize() - block = GLOB.glassesblock - ..() +/obj/item/dnainjector/antiglasses/GetInitBlock() + return GLOB.glassesblock /obj/item/dnainjector/glassesmut name = "DNA-Injector (Glasses)" @@ -415,9 +401,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/glassesmut/Initialize() - block = GLOB.glassesblock - ..() +/obj/item/dnainjector/glassesmut/GetInitBlock() + return GLOB.glassesblock /obj/item/dnainjector/epimut name = "DNA-Injector (Epi.)" @@ -426,9 +411,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/epimut/Initialize() - block = GLOB.epilepsyblock - ..() +/obj/item/dnainjector/epimut/GetInitBlock() + return GLOB.epilepsyblock /obj/item/dnainjector/antiepi name = "DNA-Injector (Anti-Epi.)" @@ -437,9 +421,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antiepi/Initialize() - block = GLOB.epilepsyblock - ..() +/obj/item/dnainjector/antiepi/GetInitBlock() + return GLOB.epilepsyblock /obj/item/dnainjector/anticough name = "DNA-Injector (Anti-Cough)" @@ -448,9 +431,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/anticough/Initialize() - block = GLOB.coughblock - ..() +/obj/item/dnainjector/anticough/GetInitBlock() + return GLOB.coughblock /obj/item/dnainjector/coughmut name = "DNA-Injector (Cough)" @@ -459,9 +441,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/coughmut/Initialize() - block = GLOB.coughblock - ..() +/obj/item/dnainjector/coughmut/GetInitBlock() + return GLOB.coughblock /obj/item/dnainjector/clumsymut name = "DNA-Injector (Clumsy)" @@ -470,9 +451,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/clumsymut/Initialize() - block = GLOB.clumsyblock - ..() +/obj/item/dnainjector/clumsymut/GetInitBlock() + return GLOB.clumsyblock /obj/item/dnainjector/anticlumsy name = "DNA-Injector (Anti-Clumy)" @@ -481,9 +461,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/anticlumsy/Initialize() - block = GLOB.clumsyblock - ..() +/obj/item/dnainjector/anticlumsy/GetInitBlock() + return GLOB.clumsyblock /obj/item/dnainjector/antitour name = "DNA-Injector (Anti-Tour.)" @@ -492,9 +471,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antitour/Initialize() - block = GLOB.twitchblock - ..() +/obj/item/dnainjector/antitour/GetInitBlock() + return GLOB.twitchblock /obj/item/dnainjector/tourmut name = "DNA-Injector (Tour.)" @@ -503,9 +481,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/tourmut/Initialize() - block = GLOB.twitchblock - ..() +/obj/item/dnainjector/tourmut/GetInitBlock() + return GLOB.twitchblock /obj/item/dnainjector/stuttmut name = "DNA-Injector (Stutt.)" @@ -514,9 +491,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/stuttmut/Initialize() - block = GLOB.nervousblock - ..() +/obj/item/dnainjector/stuttmut/GetInitBlock() + return GLOB.nervousblock /obj/item/dnainjector/antistutt @@ -526,9 +502,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antistutt/Initialize() - block = GLOB.nervousblock - ..() +/obj/item/dnainjector/antistutt/GetInitBlock() + return GLOB.nervousblock /obj/item/dnainjector/blindmut name = "DNA-Injector (Blind)" @@ -537,9 +512,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/blindmut/Initialize() - block = GLOB.blindblock - ..() +/obj/item/dnainjector/blindmut/GetInitBlock() + return GLOB.blindblock /obj/item/dnainjector/antiblind name = "DNA-Injector (Anti-Blind)" @@ -548,9 +522,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antiblind/Initialize() - block = GLOB.blindblock - ..() +/obj/item/dnainjector/antiblind/GetInitBlock() + return GLOB.blindblock /obj/item/dnainjector/deafmut name = "DNA-Injector (Deaf)" @@ -559,9 +532,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/deafmut/Initialize() - block = GLOB.deafblock - ..() +/obj/item/dnainjector/deafmut/GetInitBlock() + return GLOB.deafblock /obj/item/dnainjector/antideaf name = "DNA-Injector (Anti-Deaf)" @@ -570,9 +542,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antideaf/Initialize() - block = GLOB.deafblock - ..() +/obj/item/dnainjector/antideaf/GetInitBlock() + return GLOB.deafblock /obj/item/dnainjector/hallucination name = "DNA-Injector (Halluctination)" @@ -581,9 +552,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/hallucination/Initialize() - block = GLOB.hallucinationblock - ..() +/obj/item/dnainjector/hallucination/GetInitBlock() + return GLOB.hallucinationblock /obj/item/dnainjector/antihallucination name = "DNA-Injector (Anti-Hallucination)" @@ -592,9 +562,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/antihallucination/Initialize() - block = GLOB.hallucinationblock - ..() +/obj/item/dnainjector/antihallucination/GetInitBlock() + return GLOB.hallucinationblock /obj/item/dnainjector/h2m name = "DNA-Injector (Human > Monkey)" @@ -603,9 +572,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/h2m/Initialize() - block = GLOB.monkeyblock - ..() +/obj/item/dnainjector/h2m/GetInitBlock() + return GLOB.monkeyblock /obj/item/dnainjector/m2h name = "DNA-Injector (Monkey > Human)" @@ -614,9 +582,8 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/m2h/Initialize() - block = GLOB.monkeyblock - ..() +/obj/item/dnainjector/m2h/GetInitBlock() + return GLOB.monkeyblock /obj/item/dnainjector/comic @@ -626,9 +593,8 @@ value = 0xFFF forcedmutation = TRUE -/obj/item/dnainjector/comic/Initialize() - block = GLOB.comicblock - ..() +/obj/item/dnainjector/comic/GetInitBlock() + return GLOB.comicblock /obj/item/dnainjector/anticomic name = "DNA-Injector (Ant-Comic)" @@ -637,6 +603,5 @@ value = 0x001 forcedmutation = TRUE -/obj/item/dnainjector/anticomic/Initialize() - block = GLOB.comicblock - ..() +/obj/item/dnainjector/anticomic/GetInitBlock() + return GLOB.comicblock diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 460a227057d..629a85c2f09 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -565,7 +565,7 @@ origin_tech = "combat=4;bluespace=4;plasmatech=7" /obj/item/singularityhammer/Initialize(mapload) - ..() + . = ..() AddComponent(/datum/component/two_handed, \ force_wielded = 40, \ force_unwielded = force, \ @@ -634,7 +634,7 @@ origin_tech = "combat=4;powerstorage=7" /obj/item/mjollnir/Initialize(mapload) - ..() + . = ..() AddComponent(/datum/component/two_handed, \ force_wielded = 25, \ force_unwielded = force, \ diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm index eeb179d870d..83317b9d430 100644 --- a/code/game/objects/structures/noticeboard.dm +++ b/code/game/objects/structures/noticeboard.dm @@ -8,7 +8,7 @@ w_class = WEIGHT_CLASS_BULKY /obj/item/mounted/noticeboard/do_build(turf/on_wall, mob/user) - new /obj/structure/noticeboard(get_turf(user), get_dir(on_wall, user), building = TRUE) + new /obj/structure/noticeboard(get_turf(user), get_dir(on_wall, user), TRUE) qdel(src) /obj/structure/noticeboard @@ -21,21 +21,21 @@ max_integrity = 150 var/notices = 0 -/obj/structure/noticeboard/New(turf/loc, direction, building = FALSE) +/obj/structure/noticeboard/Initialize(mapload, direction, building = FALSE) . = ..() + if(building) setDir(direction) set_pixel_offsets_from_dir(-32, 32, -30, 30) update_icon(UPDATE_ICON_STATE) -/obj/structure/noticeboard/Initialize() - . = ..() for(var/obj/item/paper in loc) if(notices >= MAX_NOTICES) break if(istype(paper, /obj/item/paper)) paper.loc = src notices++ + update_icon(UPDATE_ICON_STATE) /obj/structure/noticeboard/update_icon_state() diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index d3399770979..45159cb37c4 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -100,8 +100,8 @@ desc = "Heavy duty, airtight, plastic flaps." /obj/structure/plasticflaps/mining/Initialize() + . = ..() air_update_turf(TRUE) - ..() /obj/structure/plasticflaps/mining/Destroy() var/turf/T = get_turf(src) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index f6dbf439894..b1f28b70a9a 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -172,7 +172,8 @@ GLOBAL_LIST_INIT(admin_verbs_debug, list( /client/proc/force_verb_bypass, /client/proc/show_gc_queues, /client/proc/debug_global_variables, - /client/proc/profile_code + /client/proc/profile_code, + /client/proc/debug_atom_init )) GLOBAL_LIST_INIT(admin_verbs_possess, list( /proc/possess, diff --git a/code/modules/awaymissions/loot.dm b/code/modules/awaymissions/loot.dm index faaeff82e9a..a0a1b472b71 100644 --- a/code/modules/awaymissions/loot.dm +++ b/code/modules/awaymissions/loot.dm @@ -22,4 +22,5 @@ continue new loot_path(get_turf(src)) - qdel(src) + + return INITIALIZE_HINT_QDEL diff --git a/code/modules/awaymissions/map_rng.dm b/code/modules/awaymissions/map_rng.dm deleted file mode 100644 index 598b46687f8..00000000000 --- a/code/modules/awaymissions/map_rng.dm +++ /dev/null @@ -1,51 +0,0 @@ -/obj/effect/landmark/map_loader - name = "map loader" - icon = 'icons/mob/screen_gen.dmi' - icon_state = "x2" - invisibility = 101 - anchored = TRUE - density = FALSE - opacity = FALSE - var/template_name = null - var/datum/map_template/template = null - var/centered = 1 - var/loaded = 0 - -/obj/effect/landmark/map_loader/New(turf/loc, tname) - ..() - - if(tname) - template_name = tname - if(template_name) - template = GLOB.map_templates[template_name] - -/obj/effect/landmark/map_loader/Initialize() - . = ..() - if(template) - load(template) - -/obj/effect/landmark/map_loader/set_tag() - return - -/obj/effect/landmark/map_loader/proc/load(datum/map_template/t) - if(!t) - return - if(loaded) // I wanna be super sure this loads only once - return - loaded = 1 - var/turf/pos = get_turf(src) - // Hop to nullspace so we don't get re-initialized by the map we're loading - loc = null - t.load(pos, centered = centered) - t.loaded++ - qdel(src) - -/obj/effect/landmark/map_loader/random - var/template_list = "" - -/obj/effect/landmark/map_loader/random/Initialize() - ..() - if(template_list) - template_name = safepick(splittext(template_list, ";")) - template = GLOB.map_templates[template_name] - load(template) diff --git a/code/modules/library/book.dm b/code/modules/library/book.dm index 5fb95c5811d..02316f5a95c 100644 --- a/code/modules/library/book.dm +++ b/code/modules/library/book.dm @@ -361,7 +361,7 @@ /obj/item/book/random/Initialize() ..() - var/list/books = GLOB.library_catalog.get_random_book(amount) + var/list/books = GLOB.library_catalog.get_random_book(amount, FALSE) for(var/datum/cachedbook/book as anything in books) new /obj/item/book(loc, book, TRUE, FALSE) return INITIALIZE_HINT_QDEL diff --git a/code/modules/library/library_catalog.dm b/code/modules/library/library_catalog.dm index 6e351833ee9..84f097eeea8 100644 --- a/code/modules/library/library_catalog.dm +++ b/code/modules/library/library_catalog.dm @@ -309,13 +309,13 @@ * Arguments: * * datum/library_user_data/search_terms - datum with parameters for what we want to query our DB for */ -/datum/library_catalog/proc/get_total_books(datum/library_user_data/search_terms) +/datum/library_catalog/proc/get_total_books(datum/library_user_data/search_terms, async = TRUE) var/list/search_query = build_search_query(search_terms) var/sql = "SELECT COUNT(id) FROM library" + search_query[1] var/list/sql_params = search_query[2] var/datum/db_query/count_query = SSdbcore.NewQuery(sql, sql_params) - if(!count_query.warn_execute()) + if(!count_query.warn_execute(async)) qdel(count_query) return diff --git a/code/modules/library/library_computer.dm b/code/modules/library/library_computer.dm index 9e9741d1c78..02412fd6a04 100644 --- a/code/modules/library/library_computer.dm +++ b/code/modules/library/library_computer.dm @@ -558,13 +558,13 @@ book_data["categories"] += book_category.description //we're displaying the cats onlys, so we don't need the ids cached_booklist += list(book_data) - num_pages = getmaxpages() + num_pages = getmaxpages(async) archive_page_num = clamp(archive_page_num, 1, num_pages) ///Returns the amount of pages we will need to hold all the book our DB has found -/obj/machinery/computer/library/proc/getmaxpages() +/obj/machinery/computer/library/proc/getmaxpages(async = TRUE) //if get_total_books doesn't return anything, just set pages to 1 so we don't break stuff - var/book_count = max(1, GLOB.library_catalog.get_total_books(user_data)) + var/book_count = max(1, GLOB.library_catalog.get_total_books(user_data, async)) var/page_count = round(book_count / LIBRARY_BOOKS_PER_PAGE) //Since 'round' gets the floor value it's likely there will be 1 page more than //the page count amount (almost guaranteed), we check for a remainder because of this diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm index b0abf709371..f003c6ecfc2 100644 --- a/code/modules/mapping/mapping_helpers.dm +++ b/code/modules/mapping/mapping_helpers.dm @@ -66,7 +66,7 @@ /obj/effect/mapping_helpers/Initialize(mapload) ..() - return late ? INITIALIZE_HINT_LATELOAD : qdel(src) // INITIALIZE_HINT_QDEL <-- Doesn't work + return late ? INITIALIZE_HINT_LATELOAD : INITIALIZE_HINT_QDEL /obj/effect/mapping_helpers/no_lava icon_state = "no_lava" diff --git a/code/modules/maze_generation/maze_generator.dm b/code/modules/maze_generation/maze_generator.dm index 04b72a6aca4..447017b4aa4 100644 --- a/code/modules/maze_generation/maze_generator.dm +++ b/code/modules/maze_generation/maze_generator.dm @@ -64,7 +64,6 @@ LOG_MAZE_PROGRESS(calculate_loot_spots(), "Loot Spot Calculation") LOG_MAZE_PROGRESS(apply_loot_modules(), "Loot Modules") log_debug("\[MAZE] Generation of maze at [x],[y],[z] complete within [stop_watch(total_time)]s") - qdel(src) /obj/effect/mazegen/generator/proc/generate_path() // Setup our turf list diff --git a/code/modules/mining/equipment/survival_pod.dm b/code/modules/mining/equipment/survival_pod.dm index 49f7bbec1f1..94afc18e880 100644 --- a/code/modules/mining/equipment/survival_pod.dm +++ b/code/modules/mining/equipment/survival_pod.dm @@ -263,7 +263,7 @@ var/buildstackamount = 5 /obj/structure/fans/Initialize(loc) - ..() + . = ..() air_update_turf(1) /obj/structure/fans/Destroy() diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 352c05b2808..9bb5db6aea7 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -398,7 +398,7 @@ //Preload Syringes /obj/item/gun/syringemalf/Initialize(mapload) - ..() + . = ..() chambered = new /obj/item/ammo_casing/syringegun(src) process_chamber() diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index ad8101088b0..215803c13d0 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -38,7 +38,7 @@ /obj/structure/filingcabinet/Initialize(mapload) - ..() + . = ..() for(var/obj/item/I in loc) if(istype(I, /obj/item/paper) || istype(I, /obj/item/folder) || istype(I, /obj/item/photo)) I.loc = src diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 6a3d492555a..f55701150fd 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -64,7 +64,7 @@ var/pen_colour_iconstate = "pencolor" /obj/item/pen/multi/Initialize(mapload) - ..() + . = ..() update_icon() /obj/item/pen/multi/proc/select_colour(mob/user as mob) diff --git a/code/modules/power/generators/turbine.dm b/code/modules/power/generators/turbine.dm index cd8a1078922..e81f4337882 100644 --- a/code/modules/power/generators/turbine.dm +++ b/code/modules/power/generators/turbine.dm @@ -18,7 +18,7 @@ // S CT * T - Turbine // * ^ * * V * D - Doors with firedoor // **|***D**|** ^ - Fuel feed (Not vent, but a gas outlet) -// | | V - Suction vent (Like the ones in atmos +// | | V - Suction vent (Like the ones in atmos) // #define OVERDRIVE 4 @@ -407,8 +407,10 @@ /obj/machinery/computer/turbine_computer/Initialize() ..() - spawn(10) - locate_machinery() + return INITIALIZE_HINT_LATELOAD + +/obj/machinery/computer/turbine_computer/LateInitialize() + locate_machinery() /obj/machinery/computer/turbine_computer/proc/disconnect() //this disconnects the computer from the turbine, good for resets. diff --git a/code/modules/projectiles/guns/syringe_gun.dm b/code/modules/projectiles/guns/syringe_gun.dm index c930fb9efa2..091b37dd56b 100644 --- a/code/modules/projectiles/guns/syringe_gun.dm +++ b/code/modules/projectiles/guns/syringe_gun.dm @@ -15,7 +15,7 @@ var/max_syringes = 1 /obj/item/gun/syringe/Initialize() - ..() + . = ..() chambered = new /obj/item/ammo_casing/syringegun(src) /obj/item/gun/syringe/process_chamber() diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index c20c2c4cdaa..dc628655580 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -423,7 +423,7 @@ var/recharge_rate = 1 // Keep this as an integer /obj/item/handheld_chem_dispenser/Initialize() - ..() + . = ..() cell = new(src) dispensable_reagents = sortList(dispensable_reagents) current_reagent = pick(dispensable_reagents) diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index ce515e4ffe2..04d8ee6a358 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -68,8 +68,8 @@ if(initial(tempCheck.icon_state) != null) critical_items += I -/obj/machinery/r_n_d/experimentor/Initialize(mapload) - ..() +/obj/machinery/r_n_d/experimentor/Initialize(mapload) // DIEEEEEEEEEEEEEEEEEEEEEEE + . = ..() component_parts = list() component_parts += new /obj/item/circuitboard/experimentor(src) component_parts += new /obj/item/stock_parts/scanning_module(src) diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index cceda0d9ae6..0eb7290c88d 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -161,7 +161,7 @@ server_id = -1 /obj/machinery/r_n_d/server/centcom/Initialize() - ..() + . = ..() var/list/no_id_servers = list() var/list/server_ids = list() for(var/obj/machinery/r_n_d/server/S in GLOB.machines) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 36343d811fa..1a7dd0f29ba 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -532,7 +532,7 @@ var/target_area = /area/mine/unexplored /obj/docking_port/stationary/random/Initialize() - ..() + . = ..() var/list/turfs = get_area_turfs(target_area) var/turf/T = pick(turfs) src.loc = T diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 12776a8ccea..ca248928dbb 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -808,6 +808,8 @@ var/admin_controlled var/max_connect_range = 7 var/moved = FALSE //workaround for nukie shuttle, hope I find a better way to do this... + /// Do we want to search for shuttle destinations as part of Initialize (fixed) or LateInitialize (variable) + var/find_destinations_in_late_init = FALSE /obj/machinery/computer/shuttle/New(location, obj/item/circuitboard/shuttle/C) ..() @@ -817,6 +819,12 @@ /obj/machinery/computer/shuttle/Initialize(mapload) . = ..() + if(find_destinations_in_late_init && mapload) // We only care about this in mapload, if its mid round its fine + return INITIALIZE_HINT_LATELOAD + + connect() + +/obj/machinery/computer/shuttle/LateInitialize() connect() /obj/machinery/computer/shuttle/proc/connect() @@ -952,27 +960,7 @@ circuit = /obj/item/circuitboard/white_ship shuttleId = "whiteship" possible_destinations = null // Set at runtime - -/obj/machinery/computer/shuttle/white_ship/Initialize(mapload) - if(mapload) - return INITIALIZE_HINT_LATELOAD - return ..() - -// Yes. This is disgusting, but the console needs to be loaded AFTER the docking ports load. -/obj/machinery/computer/shuttle/white_ship/LateInitialize() - Initialize() - -/obj/machinery/computer/shuttle/engineering - name = "Engineering Shuttle Console" - desc = "Used to call and send the engineering shuttle." - shuttleId = "engineering" - possible_destinations = "engineering_home;engineering_away" - -/obj/machinery/computer/shuttle/science - name = "Science Shuttle Console" - desc = "Used to call and send the science shuttle." - shuttleId = "science" - possible_destinations = "science_home;science_away" + find_destinations_in_late_init = TRUE /obj/machinery/computer/shuttle/admin name = "admin shuttle console" diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 9853fc4e78b..0e529da1d8b 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -53,7 +53,7 @@ var/blocking_item = "ERR_UNKNOWN" /obj/docking_port/mobile/supply/Initialize() - ..() + . = ..() for(var/T in subtypesof(/datum/economy/simple_seller)) var/datum/economy/simple_seller/seller = new T simple_sellers += seller diff --git a/code/modules/space_management/space_level.dm b/code/modules/space_management/space_level.dm index 5512447e346..a595a626d15 100644 --- a/code/modules/space_management/space_level.dm +++ b/code/modules/space_management/space_level.dm @@ -145,7 +145,6 @@ GLOBAL_LIST_INIT(atmos_machine_typecache, typecacheof(/obj/machinery/atmospherics)) GLOBAL_LIST_INIT(cable_typecache, typecacheof(/obj/structure/cable)) -GLOBAL_LIST_INIT(maploader_typecache, typecacheof(/obj/effect/landmark/map_loader)) /datum/space_level/proc/resume_init() if(dirt_count > 0) @@ -156,12 +155,8 @@ GLOBAL_LIST_INIT(maploader_typecache, typecacheof(/obj/effect/landmark/map_loade init_list = list() var/watch = start_watch() listclearnulls(our_atoms) - var/list/late_maps = typecache_filter_list(our_atoms, GLOB.maploader_typecache) var/list/pipes = typecache_filter_list(our_atoms, GLOB.atmos_machine_typecache) var/list/cables = typecache_filter_list(our_atoms, GLOB.cable_typecache) - // If we don't carefully add dirt around the map templates, bad stuff happens - // so we separate them out here - our_atoms -= late_maps SSatoms.InitializeAtoms(our_atoms, FALSE) log_debug("Primary initialization finished in [stop_watch(watch)]s.") our_atoms.Cut() @@ -169,8 +164,6 @@ GLOBAL_LIST_INIT(maploader_typecache, typecacheof(/obj/effect/landmark/map_loade do_pipes(pipes) if(length(cables)) do_cables(cables) - if(length(late_maps)) - do_late_maps(late_maps) /datum/space_level/proc/do_pipes(list/pipes) var/watch = start_watch() @@ -189,13 +182,3 @@ GLOBAL_LIST_INIT(maploader_typecache, typecacheof(/obj/effect/landmark/map_loade SSmachines.setup_template_powernets(cables) cables.Cut() log_debug("Took [stop_watch(watch)]s") - -/datum/space_level/proc/do_late_maps(list/late_maps) - var/watch = start_watch() - log_debug("Loading map templates on z-level '[zpos]'!") - GLOB.space_manager.add_dirt(zpos) // Let's not repeatedly resume init for each template - for(var/atom/movable/AM in late_maps) - AM.Initialize() - late_maps.Cut() - GLOB.space_manager.remove_dirt(zpos) - log_debug("Took [stop_watch(watch)]s") diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index 92923a597cc..569f121d9a8 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -293,7 +293,7 @@ target_all_areas = TRUE /obj/machinery/computer/bsa_control/admin/Initialize() - ..() + . = ..() if(!cannon) cannon = deploy() diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index f1e1b6c8300..cbaa4b3043f 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -12,6 +12,7 @@ #include "config_sanity.dm" #include "crafting_lists.dm" #include "emotes.dm" +#include "init_sanity.dm" #include "log_format.dm" #include "map_templates.dm" #include "map_tests.dm" diff --git a/code/modules/unit_tests/init_sanity.dm b/code/modules/unit_tests/init_sanity.dm new file mode 100644 index 00000000000..1584179cbe7 --- /dev/null +++ b/code/modules/unit_tests/init_sanity.dm @@ -0,0 +1,11 @@ +/datum/unit_test/initialize_sanity/Run() + if(length(SSatoms.BadInitializeCalls)) + Fail("Bad Initialize() calls detected. Please read logs.") + var/list/init_failures_to_text = list( + "[BAD_INIT_QDEL_BEFORE]" = "Qdeleted Before Initialized", + "[BAD_INIT_DIDNT_INIT]" = "Did Not Initialize", + "[BAD_INIT_SLEPT]" = "Initialize() Slept", + "[BAD_INIT_NO_HINT]" = "No Initialize() Hint Returned", + ) + for(var/failure in SSatoms.BadInitializeCalls) + Fail("[failure]: [init_failures_to_text["[SSatoms.BadInitializeCalls[failure]]"]]") // You like stacked brackets? diff --git a/paradise.dme b/paradise.dme index e307ba51e9b..ae82570d648 100644 --- a/paradise.dme +++ b/paradise.dme @@ -37,6 +37,7 @@ #include "code\__DEFINES\armour.dm" #include "code\__DEFINES\asset_defines.dm" #include "code\__DEFINES\atmospherics_defines.dm" +#include "code\__DEFINES\atom_states.dm" #include "code\__DEFINES\bio_chip_defines.dm" #include "code\__DEFINES\bitfields_defines.dm" #include "code\__DEFINES\bots.dm" @@ -1579,7 +1580,6 @@ #include "code\modules\atmospherics\machinery\portable\portable_pump.dm" #include "code\modules\atmospherics\machinery\portable\scrubber.dm" #include "code\modules\awaymissions\loot.dm" -#include "code\modules\awaymissions\map_rng.dm" #include "code\modules\awaymissions\mob_spawn.dm" #include "code\modules\awaymissions\zlevel_helpers.dm" #include "code\modules\awaymissions\maploader\dmm_suite.dm"