diff --git a/code/game/atom/atoms_initializing_EXPENSIVE.dm b/code/game/atom/atoms_initializing_EXPENSIVE.dm index a55666aed9a..c603ae55148 100644 --- a/code/game/atom/atoms_initializing_EXPENSIVE.dm +++ b/code/game/atom/atoms_initializing_EXPENSIVE.dm @@ -162,3 +162,5 @@ */ /atom/proc/LateInitialize() set waitfor = FALSE + SHOULD_CALL_PARENT(FALSE) + stack_trace("[src] ([type]) called LateInitialize but has nothing on it!") diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 0d4f1d64cea..8fc86970524 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -184,12 +184,8 @@ return INITIALIZE_HINT_LATELOAD /obj/machinery/LateInitialize() - . = ..() - power_change() - if(use_power == NO_POWER_USE) - return - update_current_power_usage() - setup_area_power_relationship() + SHOULD_NOT_OVERRIDE(TRUE) + post_machine_initialize() /obj/machinery/Destroy(force) SSmachines.unregister_machine(src) @@ -200,6 +196,20 @@ return ..() +/** + * Called in LateInitialize meant to be the machine replacement to it + * This sets up power for the machine and requires parent be called, + * ensuring power works on all machines unless exempted with NO_POWER_USE. + * This is the proc to override if you want to do anything in LateInitialize. + */ +/obj/machinery/proc/post_machine_initialize() + SHOULD_CALL_PARENT(TRUE) + power_change() + if(use_power == NO_POWER_USE) + return + update_current_power_usage() + setup_area_power_relationship() + /** * proc to call when the machine starts to require power after a duration of not requiring power * sets up power related connections to its area if it exists and becomes area sensitive diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index bb9ef7d3fc5..2cd0506cbfd 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -66,7 +66,7 @@ /** * Autonaming camera - * Automatically names itself after the area it's in during LateInitialize, + * Automatically names itself after the area it's in during post_machine_initialize, * good for mappers who don't want to manually name them all. */ /obj/machinery/camera/autoname @@ -76,7 +76,7 @@ ..() return INITIALIZE_HINT_LATELOAD -/obj/machinery/camera/autoname/LateInitialize() +/obj/machinery/camera/autoname/post_machine_initialize() . = ..() var/static/list/autonames_in_areas = list() var/area/camera_area = get_area(src) diff --git a/code/game/machinery/civilian_bounties.dm b/code/game/machinery/civilian_bounties.dm index 2d284b17b67..d2a584a1675 100644 --- a/code/game/machinery/civilian_bounties.dm +++ b/code/game/machinery/civilian_bounties.dm @@ -60,7 +60,7 @@ pad_ref = WEAKREF(I.buffer) return TRUE -/obj/machinery/computer/piratepad_control/civilian/LateInitialize() +/obj/machinery/computer/piratepad_control/civilian/post_machine_initialize() . = ..() if(cargo_hold_id) for(var/obj/machinery/piratepad/civilian/C as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/piratepad/civilian)) diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index c2b487c1474..e0e132a81e3 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -235,7 +235,7 @@ // Set the default tgui state set_default_state() -/obj/machinery/computer/scan_consolenew/LateInitialize() +/obj/machinery/computer/scan_consolenew/post_machine_initialize() . = ..() // Link machine with research techweb. Used for discovering and accessing // already discovered mutations diff --git a/code/game/machinery/computer/mechlaunchpad.dm b/code/game/machinery/computer/mechlaunchpad.dm index 106f87f1788..7b80b6e95c8 100644 --- a/code/game/machinery/computer/mechlaunchpad.dm +++ b/code/game/machinery/computer/mechlaunchpad.dm @@ -34,7 +34,8 @@ SIGNAL_HANDLER connected_mechpad = null -/obj/machinery/computer/mechpad/LateInitialize() +/obj/machinery/computer/mechpad/post_machine_initialize() + . = ..() for(var/obj/machinery/mechpad/pad as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/mechpad)) if(pad == connected_mechpad) continue diff --git a/code/game/machinery/computer/operating_computer.dm b/code/game/machinery/computer/operating_computer.dm index da6821814a5..b60f3a67b64 100644 --- a/code/game/machinery/computer/operating_computer.dm +++ b/code/game/machinery/computer/operating_computer.dm @@ -20,7 +20,7 @@ find_table() return INITIALIZE_HINT_LATELOAD -/obj/machinery/computer/operating/LateInitialize() +/obj/machinery/computer/operating/post_machine_initialize() . = ..() if(!CONFIG_GET(flag/no_default_techweb_link) && !linked_techweb) CONNECT_TO_RND_SERVER_ROUNDSTART(linked_techweb, src) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 87acada7793..46a6fe0e954 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -2168,7 +2168,7 @@ return ..() -/obj/machinery/door/airlock/external/LateInitialize() +/obj/machinery/door/airlock/external/post_machine_initialize() . = ..() if(space_dir) unres_sides |= space_dir diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 983014e7b71..22efac7cd21 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -91,7 +91,7 @@ RegisterSignal(src, COMSIG_MACHINERY_POWER_LOST, PROC_REF(on_power_loss)) return INITIALIZE_HINT_LATELOAD -/obj/machinery/door/firedoor/LateInitialize() +/obj/machinery/door/firedoor/post_machine_initialize() . = ..() RegisterSignal(src, COMSIG_MERGER_ADDING, PROC_REF(merger_adding)) RegisterSignal(src, COMSIG_MERGER_REMOVING, PROC_REF(merger_removing)) diff --git a/code/game/machinery/embedded_controller/access_controller.dm b/code/game/machinery/embedded_controller/access_controller.dm index b4cfeac32f6..540ba707671 100644 --- a/code/game/machinery/embedded_controller/access_controller.dm +++ b/code/game/machinery/embedded_controller/access_controller.dm @@ -16,7 +16,8 @@ ..() return INITIALIZE_HINT_LATELOAD -/obj/machinery/door_buttons/LateInitialize() +/obj/machinery/door_buttons/post_machine_initialize() + . = ..() find_objects_by_tag() /obj/machinery/door_buttons/emag_act(mob/user, obj/item/card/emag/emag_card) diff --git a/code/game/machinery/embedded_controller/airlock_controller.dm b/code/game/machinery/embedded_controller/airlock_controller.dm index 0e5e7701696..bd7a98c68f3 100644 --- a/code/game/machinery/embedded_controller/airlock_controller.dm +++ b/code/game/machinery/embedded_controller/airlock_controller.dm @@ -34,7 +34,7 @@ var/processing = FALSE -/obj/machinery/airlock_controller/LateInitialize() +/obj/machinery/airlock_controller/post_machine_initialize() . = ..() var/obj/machinery/door/interior_door = GLOB.objects_by_id_tag[interior_door_tag] diff --git a/code/game/machinery/incident_display.dm b/code/game/machinery/incident_display.dm index fcdfecf6a31..b8452675c71 100644 --- a/code/game/machinery/incident_display.dm +++ b/code/game/machinery/incident_display.dm @@ -80,7 +80,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/incident_display/tram, 32) ..() return INITIALIZE_HINT_LATELOAD -/obj/machinery/incident_display/LateInitialize() +/obj/machinery/incident_display/post_machine_initialize() . = ..() GLOB.map_delamination_counters += src update_delam_count(SSpersistence.rounds_since_engine_exploded, SSpersistence.delam_highscore) diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 405a38e4167..9cbf787d58d 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -35,7 +35,7 @@ . = ..() return INITIALIZE_HINT_LATELOAD -/obj/machinery/recycler/LateInitialize() +/obj/machinery/recycler/post_machine_initialize() . = ..() update_appearance(UPDATE_ICON) req_one_access = SSid_access.get_region_access_list(list(REGION_ALL_STATION, REGION_CENTCOM)) diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index ab2a3f8cefc..1998654df00 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -74,7 +74,8 @@ GLOB.telecomms_list += src return INITIALIZE_HINT_LATELOAD -/obj/machinery/computer/message_monitor/LateInitialize() +/obj/machinery/computer/message_monitor/post_machine_initialize() + . = ..() //Is the server isn't linked to a server, and there's a server available, default it to the first one in the list. if(!linkedServer) for(var/obj/machinery/telecomms/message_server/message_server in GLOB.telecomms_list) @@ -280,12 +281,11 @@ name = "monitor decryption key" /obj/item/paper/monitorkey/Initialize(mapload, obj/machinery/telecomms/message_server/server) - ..() + . = ..() if (server) print(server) return INITIALIZE_HINT_NORMAL - else - return INITIALIZE_HINT_LATELOAD + return INITIALIZE_HINT_LATELOAD /** * Handles printing the monitor key for a given server onto this piece of paper. diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index b8d0414ad28..ee71ca0233d 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -105,9 +105,8 @@ GLOBAL_LIST_EMPTY(telecomms_list) if(mapload && autolinkers.len) return INITIALIZE_HINT_LATELOAD -/obj/machinery/telecomms/LateInitialize() - ..() - +/obj/machinery/telecomms/post_machine_initialize() + . = ..() for(var/obj/machinery/telecomms/telecomms_machine in GLOB.telecomms_list) if (long_range_link || IN_GIVEN_RANGE(src, telecomms_machine, 20)) add_automatic_link(telecomms_machine) diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm index 76522819d08..75be8313f19 100644 --- a/code/game/objects/effects/landmarks.dm +++ b/code/game/objects/effects/landmarks.dm @@ -512,7 +512,6 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player) return ..() /obj/effect/landmark/start/hangover/LateInitialize() - . = ..() if(HAS_TRAIT(SSstation, STATION_TRAIT_BIRTHDAY)) party_debris += new /obj/effect/decal/cleanable/confetti(get_turf(src)) //a birthday celebration can also be a hangover var/list/bonus_confetti = GLOB.alldirs @@ -593,7 +592,6 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player) return INITIALIZE_HINT_LATELOAD /obj/effect/landmark/navigate_destination/LateInitialize() - . = ..() if(!location) var/obj/machinery/door/airlock/A = locate(/obj/machinery/door/airlock) in loc location = A ? format_text(A.name) : get_area_name(src, format_text = TRUE) diff --git a/code/game/objects/items/puzzle_pieces.dm b/code/game/objects/items/puzzle_pieces.dm index 77b07488d6c..1fabf13d31a 100644 --- a/code/game/objects/items/puzzle_pieces.dm +++ b/code/game/objects/items/puzzle_pieces.dm @@ -323,7 +323,7 @@ SSqueuelinks.add_to_queue(src, id, late_initialize_pop ? 0 : queue_size) return late_initialize_pop ? INITIALIZE_HINT_LATELOAD : . -/obj/machinery/puzzle/LateInitialize() +/obj/machinery/puzzle/post_machine_initialize() . = ..() if(late_initialize_pop && id && SSqueuelinks.queues[id]) SSqueuelinks.pop_link(id) diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm index 02f611eb4e3..a26a2f92784 100644 --- a/code/game/objects/structures/bonfire.dm +++ b/code/game/objects/structures/bonfire.dm @@ -191,7 +191,6 @@ // Late init so that we can wait for air to exist in lazyloaded templates /obj/structure/bonfire/prelit/LateInitialize() - . = ..() start_burning() #undef BONFIRE_FIRE_STACK_STRENGTH diff --git a/code/game/objects/structures/broken_flooring.dm b/code/game/objects/structures/broken_flooring.dm index 3d1fa986505..9b2e4729080 100644 --- a/code/game/objects/structures/broken_flooring.dm +++ b/code/game/objects/structures/broken_flooring.dm @@ -16,7 +16,6 @@ return INITIALIZE_HINT_LATELOAD /obj/structure/broken_flooring/LateInitialize() - . = ..() var/turf/turf = get_turf(src) if(!isplatingturf(turf) && !always_floorplane) // Render as trash if not on plating plane = GAME_PLANE diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index dc273bdc938..8eb584ac88a 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -163,7 +163,6 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets) update_appearance() /obj/structure/closet/LateInitialize() - . = ..() if(!opened && is_maploaded) take_contents() diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 0653918e026..c44cd0972aa 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -46,20 +46,20 @@ var/static/list/crate_paint_jobs if(isnull(crate_paint_jobs)) crate_paint_jobs = list( - "Internals" = list("icon_state" = "o2crate"), - "Medical" = list("icon_state" = "medical"), - "Medical Plus" = list("icon_state" = "medicalcrate"), - "Radiation" = list("icon_state" = "radiation"), - "Hydrophonics" = list("icon_state" = "hydrocrate"), - "Science" = list("icon_state" = "scicrate"), - "Robotics" = list("icon_state" = "robo"), - "Solar" = list("icon_state" = "engi_e_crate"), - "Engineering" = list("icon_state" = "engi_crate"), - "Atmospherics" = list("icon_state" = "atmos"), - "Cargo" = list("icon_state" = "cargo"), - "Mining" = list("icon_state" = "mining"), - "Command" = list("icon_state" = "centcom") - ) + "Internals" = list("icon_state" = "o2crate"), + "Medical" = list("icon_state" = "medical"), + "Medical Plus" = list("icon_state" = "medicalcrate"), + "Radiation" = list("icon_state" = "radiation"), + "Hydrophonics" = list("icon_state" = "hydrocrate"), + "Science" = list("icon_state" = "scicrate"), + "Robotics" = list("icon_state" = "robo"), + "Solar" = list("icon_state" = "engi_e_crate"), + "Engineering" = list("icon_state" = "engi_crate"), + "Atmospherics" = list("icon_state" = "atmos"), + "Cargo" = list("icon_state" = "cargo"), + "Mining" = list("icon_state" = "mining"), + "Command" = list("icon_state" = "centcom"), + ) if(paint_jobs) paint_jobs = crate_paint_jobs diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 2b3ea7802c5..2e01fe261a0 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -192,13 +192,11 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an /// Minimum temperature of the internal air mixture var/minimum_temperature = T0C - 60 - /obj/structure/bodycontainer/morgue/Initialize(mapload) ..() return INITIALIZE_HINT_LATELOAD /obj/structure/bodycontainer/morgue/LateInitialize() - . = ..() var/datum/gas_mixture/external_air = loc.return_air() if(external_air) internal_air = external_air.copy() diff --git a/code/game/objects/structures/plaques/static_plaques.dm b/code/game/objects/structures/plaques/static_plaques.dm index 06538ea2ef1..642a7ac125e 100644 --- a/code/game/objects/structures/plaques/static_plaques.dm +++ b/code/game/objects/structures/plaques/static_plaques.dm @@ -35,8 +35,7 @@ . = ..() return INITIALIZE_HINT_LATELOAD -/obj/structure/plaque/static_plaque/tram/LateInitialize(mapload) - . = ..() +/obj/structure/plaque/static_plaque/tram/LateInitialize() link_tram() set_tram_serial() diff --git a/code/game/turfs/open/floor/glass.dm b/code/game/turfs/open/floor/glass.dm index b1579da55f0..cece195aaf8 100644 --- a/code/game/turfs/open/floor/glass.dm +++ b/code/game/turfs/open/floor/glass.dm @@ -33,7 +33,6 @@ return INITIALIZE_HINT_LATELOAD /turf/open/floor/glass/LateInitialize() - . = ..() AddElement(/datum/element/turf_z_transparency) setup_glow() diff --git a/code/game/turfs/open/openspace.dm b/code/game/turfs/open/openspace.dm index 24345611576..d243f95d68c 100644 --- a/code/game/turfs/open/openspace.dm +++ b/code/game/turfs/open/openspace.dm @@ -32,7 +32,6 @@ return INITIALIZE_HINT_LATELOAD /turf/open/openspace/LateInitialize() - . = ..() AddElement(/datum/element/turf_z_transparency) /turf/open/openspace/ChangeTurf(path, list/new_baseturfs, flags) diff --git a/code/game/turfs/open/space/space.dm b/code/game/turfs/open/space/space.dm index d404870e1c8..1bfe5c2e5e1 100644 --- a/code/game/turfs/open/space/space.dm +++ b/code/game/turfs/open/space/space.dm @@ -273,7 +273,6 @@ GLOBAL_LIST_EMPTY(starlight) return INITIALIZE_HINT_LATELOAD /turf/open/space/openspace/LateInitialize() - . = ..() AddElement(/datum/element/turf_z_transparency) /turf/open/space/openspace/Destroy() diff --git a/code/modules/antagonists/abductor/machinery/console.dm b/code/modules/antagonists/abductor/machinery/console.dm index 5bd5ce8c2ec..ee729de7068 100644 --- a/code/modules/antagonists/abductor/machinery/console.dm +++ b/code/modules/antagonists/abductor/machinery/console.dm @@ -198,11 +198,8 @@ pad.teleport_target = location to_chat(user, span_notice("Location marked as test subject release point.")) -/obj/machinery/abductor/console/Initialize(mapload) - ..() - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/abductor/console/LateInitialize() +/obj/machinery/abductor/console/post_machine_initialize() + . = ..() if(!team_number) return diff --git a/code/modules/antagonists/pirate/pirate_shuttle_equipment.dm b/code/modules/antagonists/pirate/pirate_shuttle_equipment.dm index 2b323d51162..04ebab73cbd 100644 --- a/code/modules/antagonists/pirate/pirate_shuttle_equipment.dm +++ b/code/modules/antagonists/pirate/pirate_shuttle_equipment.dm @@ -232,7 +232,7 @@ pad_ref = WEAKREF(I.buffer) return TRUE -/obj/machinery/computer/piratepad_control/LateInitialize() +/obj/machinery/computer/piratepad_control/post_machine_initialize() . = ..() if(cargo_hold_id) for(var/obj/machinery/piratepad/P as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/piratepad)) diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index d42618e9ee9..d8d0ed3b47e 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -81,7 +81,7 @@ fire = 100 acid = 70 -/obj/machinery/atmospherics/LateInitialize() +/obj/machinery/atmospherics/post_machine_initialize() . = ..() update_name() diff --git a/code/modules/atmospherics/machinery/bluespace_vendor.dm b/code/modules/atmospherics/machinery/bluespace_vendor.dm index 84753354018..91da04afaf2 100644 --- a/code/modules/atmospherics/machinery/bluespace_vendor.dm +++ b/code/modules/atmospherics/machinery/bluespace_vendor.dm @@ -71,7 +71,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/bluespace_vendor, 30) AddComponent(/datum/component/payment, tank_cost, SSeconomy.get_dep_account(ACCOUNT_ENG), PAYMENT_ANGRY) find_and_hang_on_wall( FALSE) -/obj/machinery/bluespace_vendor/LateInitialize() +/obj/machinery/bluespace_vendor/post_machine_initialize() . = ..() if(!map_spawned) return diff --git a/code/modules/atmospherics/machinery/components/tank.dm b/code/modules/atmospherics/machinery/components/tank.dm index cf18488f052..a54e8079d0d 100644 --- a/code/modules/atmospherics/machinery/components/tank.dm +++ b/code/modules/atmospherics/machinery/components/tank.dm @@ -104,7 +104,7 @@ // We late initialize here so all stationary tanks have time to set up their // initial gas mixes and signal registrations. -/obj/machinery/atmospherics/components/tank/LateInitialize() +/obj/machinery/atmospherics/components/tank/post_machine_initialize() . = ..() GetMergeGroup(merger_id, merger_typecache) diff --git a/code/modules/bitrunning/objects/byteforge.dm b/code/modules/bitrunning/objects/byteforge.dm index f8212b7666b..b971cdae75d 100644 --- a/code/modules/bitrunning/objects/byteforge.dm +++ b/code/modules/bitrunning/objects/byteforge.dm @@ -14,7 +14,7 @@ return INITIALIZE_HINT_LATELOAD -/obj/machinery/byteforge/LateInitialize() +/obj/machinery/byteforge/post_machine_initialize() . = ..() setup_particles() diff --git a/code/modules/bitrunning/objects/netpod.dm b/code/modules/bitrunning/objects/netpod.dm index 2d4e995b19b..07b5506bb0e 100644 --- a/code/modules/bitrunning/objects/netpod.dm +++ b/code/modules/bitrunning/objects/netpod.dm @@ -24,12 +24,7 @@ /// Static list of outfits to select from var/list/cached_outfits = list() -/obj/machinery/netpod/Initialize(mapload) - . = ..() - - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/netpod/LateInitialize() +/obj/machinery/netpod/post_machine_initialize() . = ..() disconnect_damage = BASE_DISCONNECT_DAMAGE diff --git a/code/modules/bitrunning/objects/quantum_console.dm b/code/modules/bitrunning/objects/quantum_console.dm index 9dc829c48cd..9a0f48ae80b 100644 --- a/code/modules/bitrunning/objects/quantum_console.dm +++ b/code/modules/bitrunning/objects/quantum_console.dm @@ -12,11 +12,8 @@ . = ..() desc = "Even in the distant year [CURRENT_STATION_YEAR], Nanostrasen is still using REST APIs. How grim." - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/computer/quantum_console/LateInitialize() +/obj/machinery/computer/quantum_console/post_machine_initialize() . = ..() - find_server() /obj/machinery/computer/quantum_console/ui_interact(mob/user, datum/tgui/ui) diff --git a/code/modules/bitrunning/server/_parent.dm b/code/modules/bitrunning/server/_parent.dm index b9d8808607e..06b49d790a5 100644 --- a/code/modules/bitrunning/server/_parent.dm +++ b/code/modules/bitrunning/server/_parent.dm @@ -49,12 +49,7 @@ /// Cooldown between being able to toggle broadcasting COOLDOWN_DECLARE(broadcast_toggle_cd) -/obj/machinery/quantum_server/Initialize(mapload) - . = ..() - - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/quantum_server/LateInitialize() +/obj/machinery/quantum_server/post_machine_initialize() . = ..() radio = new(src) diff --git a/code/modules/capture_the_flag/ctf_game.dm b/code/modules/capture_the_flag/ctf_game.dm index e3b9fb37869..aac487a83d6 100644 --- a/code/modules/capture_the_flag/ctf_game.dm +++ b/code/modules/capture_the_flag/ctf_game.dm @@ -221,7 +221,6 @@ return INITIALIZE_HINT_LATELOAD /obj/item/ctf_flag/LateInitialize() - . = ..() ctf_game = GLOB.ctf_games[game_id] //Flags don't create ctf games by themselves since you can get ctf flags from christmas trees. /obj/item/ctf_flag/Destroy() diff --git a/code/modules/capture_the_flag/medieval_sim/medisim_game.dm b/code/modules/capture_the_flag/medieval_sim/medisim_game.dm index 3546ce0881d..18e1cd13e7e 100644 --- a/code/modules/capture_the_flag/medieval_sim/medisim_game.dm +++ b/code/modules/capture_the_flag/medieval_sim/medisim_game.dm @@ -12,9 +12,8 @@ /obj/machinery/ctf/spawner/medisim/Initialize(mapload) . = ..() ctf_game.setup_rules(victory_rejoin_text = "Teams have been cleared. The next game is starting automatically. Rejoin a team if you wish!", auto_restart = TRUE) - return INITIALIZE_HINT_LATELOAD //Start CTF needs to run after both medisim spawners have initalized. -/obj/machinery/ctf/spawner/medisim/LateInitialize() +/obj/machinery/ctf/spawner/medisim/post_machine_initialize() . = ..() ctf_game.start_ctf() diff --git a/code/modules/experisci/destructive_scanner.dm b/code/modules/experisci/destructive_scanner.dm index 5740b715bd4..d5d87eb6311 100644 --- a/code/modules/experisci/destructive_scanner.dm +++ b/code/modules/experisci/destructive_scanner.dm @@ -12,12 +12,8 @@ layer = MOB_LAYER var/scanning = FALSE -/obj/machinery/destructive_scanner/Initialize(mapload) - ..() - return INITIALIZE_HINT_LATELOAD - // Late load to ensure the component initialization occurs after the machines are initialized -/obj/machinery/destructive_scanner/LateInitialize() +/obj/machinery/destructive_scanner/post_machine_initialize() . = ..() var/static/list/destructive_signals = list( diff --git a/code/modules/experisci/handheld_scanner.dm b/code/modules/experisci/handheld_scanner.dm index 32309336e3c..390937e0dd4 100644 --- a/code/modules/experisci/handheld_scanner.dm +++ b/code/modules/experisci/handheld_scanner.dm @@ -18,7 +18,6 @@ // Late initialize to allow for the rnd servers to initialize first /obj/item/experi_scanner/LateInitialize() - . = ..() var/static/list/handheld_signals = list( COMSIG_ITEM_PRE_ATTACK = TYPE_PROC_REF(/datum/component/experiment_handler, try_run_handheld_experiment), COMSIG_ITEM_AFTERATTACK = TYPE_PROC_REF(/datum/component/experiment_handler, ignored_handheld_experiment_attempt), diff --git a/code/modules/explorer_drone/scanner_array.dm b/code/modules/explorer_drone/scanner_array.dm index 05f1d9a8b8f..6317ee273be 100644 --- a/code/modules/explorer_drone/scanner_array.dm +++ b/code/modules/explorer_drone/scanner_array.dm @@ -181,11 +181,7 @@ GLOBAL_LIST_INIT(scan_conditions,init_scan_conditions()) failed_popup = TRUE SStgui.update_uis(src) -/obj/machinery/computer/exoscanner_control/Initialize(mapload) - ..() - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/computer/exoscanner_control/LateInitialize() +/obj/machinery/computer/exoscanner_control/post_machine_initialize() . = ..() AddComponent(/datum/component/experiment_handler, \ allowed_experiments = list(/datum/experiment/exploration_scan), \ diff --git a/code/modules/holodeck/computer.dm b/code/modules/holodeck/computer.dm index 7b4b23a313b..db66578c5bd 100644 --- a/code/modules/holodeck/computer.dm +++ b/code/modules/holodeck/computer.dm @@ -84,11 +84,8 @@ GLOBAL_LIST_INIT(typecache_holodeck_linked_floorcheck_ok, typecacheof(list(/turf //creates the timer that determines if another program can be manually loaded COOLDOWN_DECLARE(holodeck_cooldown) -/obj/machinery/computer/holodeck/Initialize(mapload) - ..() - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/computer/holodeck/LateInitialize()//from here linked is populated and the program list is generated. its also set to load the offline program +/obj/machinery/computer/holodeck/post_machine_initialize() //from here linked is populated and the program list is generated. its also set to load the offline program + . = ..() linked = GLOB.areas_by_type[mapped_start_area] if(!linked) log_mapping("[src] at [AREACOORD(src)] has no matching holodeck area.") diff --git a/code/modules/mapfluff/ruins/objects_and_mobs/museum.dm b/code/modules/mapfluff/ruins/objects_and_mobs/museum.dm index 8a2949f9893..5c1b4323208 100644 --- a/code/modules/mapfluff/ruins/objects_and_mobs/museum.dm +++ b/code/modules/mapfluff/ruins/objects_and_mobs/museum.dm @@ -185,7 +185,6 @@ return INITIALIZE_HINT_LATELOAD /obj/item/keycard/cafeteria/LateInitialize() - . = ..() if(SSqueuelinks.queues[CAFE_KEYCARD_TOILETS]) SSqueuelinks.pop_link(CAFE_KEYCARD_TOILETS) diff --git a/code/modules/mapping/mail_sorting_helpers.dm b/code/modules/mapping/mail_sorting_helpers.dm index 964a4998600..259b9ef8f37 100644 --- a/code/modules/mapping/mail_sorting_helpers.dm +++ b/code/modules/mapping/mail_sorting_helpers.dm @@ -3,10 +3,6 @@ late = TRUE var/sort_type = SORT_TYPE_WASTE -/obj/effect/mapping_helpers/mail_sorting/Initialize(mapload) - ..() - return INITIALIZE_HINT_LATELOAD - /obj/effect/mapping_helpers/mail_sorting/LateInitialize() var/obj/structure/disposalpipe/sorting/mail/mail_sorter = locate(/obj/structure/disposalpipe/sorting/mail) in loc if(mail_sorter) diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm index e601256a8b6..a2ffa244679 100644 --- a/code/modules/mapping/mapping_helpers.dm +++ b/code/modules/mapping/mapping_helpers.dm @@ -138,7 +138,6 @@ payload(airlock) /obj/effect/mapping_helpers/airlock/LateInitialize() - . = ..() var/obj/machinery/door/airlock/airlock = locate(/obj/machinery/door/airlock) in loc if(!airlock) qdel(src) @@ -283,7 +282,6 @@ return INITIALIZE_HINT_LATELOAD /obj/effect/mapping_helpers/airalarm/LateInitialize() - . = ..() var/obj/machinery/airalarm/target = locate(/obj/machinery/airalarm) in loc if(isnull(target)) @@ -442,7 +440,6 @@ return INITIALIZE_HINT_LATELOAD /obj/effect/mapping_helpers/apc/LateInitialize() - . = ..() var/obj/machinery/power/apc/target = locate(/obj/machinery/power/apc) in loc if(isnull(target)) @@ -1106,8 +1103,8 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) */ /obj/effect/mapping_helpers/trapdoor_placer name = "trapdoor placer" - late = TRUE icon_state = "trapdoor" + late = TRUE /obj/effect/mapping_helpers/trapdoor_placer/LateInitialize() var/turf/component_target = get_turf(src) @@ -1187,12 +1184,8 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) name = "broken floor" icon = 'icons/turf/damaged.dmi' icon_state = "damaged1" - late = TRUE layer = ABOVE_NORMAL_TURF_LAYER - -/obj/effect/mapping_helpers/broken_floor/Initialize(mapload) - .=..() - return INITIALIZE_HINT_LATELOAD + late = TRUE /obj/effect/mapping_helpers/broken_floor/LateInitialize() var/turf/open/floor/floor = get_turf(src) @@ -1203,12 +1196,8 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) name = "burnt floor" icon = 'icons/turf/damaged.dmi' icon_state = "floorscorched1" - late = TRUE layer = ABOVE_NORMAL_TURF_LAYER - -/obj/effect/mapping_helpers/burnt_floor/Initialize(mapload) - .=..() - return INITIALIZE_HINT_LATELOAD + late = TRUE /obj/effect/mapping_helpers/burnt_floor/LateInitialize() var/turf/open/floor/floor = get_turf(src) @@ -1237,7 +1226,6 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) return INITIALIZE_HINT_LATELOAD /obj/effect/mapping_helpers/broken_machine/LateInitialize() - . = ..() var/obj/machinery/target = locate(/obj/machinery) in loc if(isnull(target)) @@ -1271,7 +1259,6 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) return INITIALIZE_HINT_LATELOAD /obj/effect/mapping_helpers/damaged_window/LateInitialize() - . = ..() var/obj/structure/window/target = locate(/obj/structure/window) in loc if(isnull(target)) @@ -1304,7 +1291,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) return INITIALIZE_HINT_LATELOAD -/obj/effect/mapping_helpers/requests_console/LateInitialize(mapload) +/obj/effect/mapping_helpers/requests_console/LateInitialize() var/obj/machinery/airalarm/target = locate(/obj/machinery/requests_console) in loc if(isnull(target)) var/area/target_area = get_area(target) @@ -1441,7 +1428,6 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) return INITIALIZE_HINT_QDEL /obj/effect/mapping_helpers/basic_mob_flags/LateInitialize() - . = ..() var/had_any_mobs = FALSE for(var/mob/living/basic/basic_mobs in loc) had_any_mobs = TRUE diff --git a/code/modules/mining/boulder_processing/_boulder_processing.dm b/code/modules/mining/boulder_processing/_boulder_processing.dm index 0dfc43cf7f7..f30fd24ae6c 100644 --- a/code/modules/mining/boulder_processing/_boulder_processing.dm +++ b/code/modules/mining/boulder_processing/_boulder_processing.dm @@ -38,7 +38,7 @@ register_context() -/obj/machinery/bouldertech/LateInitialize() +/obj/machinery/bouldertech/post_machine_initialize() . = ..() var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = PROC_REF(on_entered), diff --git a/code/modules/mob/living/basic/bots/medbot/medbot.dm b/code/modules/mob/living/basic/bots/medbot/medbot.dm index bd97806c760..12a433f9921 100644 --- a/code/modules/mob/living/basic/bots/medbot/medbot.dm +++ b/code/modules/mob/living/basic/bots/medbot/medbot.dm @@ -162,7 +162,6 @@ return INITIALIZE_HINT_LATELOAD /mob/living/basic/bot/medbot/LateInitialize() - . = ..() if(!CONFIG_GET(flag/no_default_techweb_link) && !linked_techweb) CONNECT_TO_RND_SERVER_ROUNDSTART(linked_techweb, src) diff --git a/code/modules/modular_computers/computers/machinery/console_presets.dm b/code/modules/modular_computers/computers/machinery/console_presets.dm index 18f394d6ee0..bc277a72313 100644 --- a/code/modules/modular_computers/computers/machinery/console_presets.dm +++ b/code/modules/modular_computers/computers/machinery/console_presets.dm @@ -144,7 +144,7 @@ update_appearance(UPDATE_ICON) // Rest of the chat program setup is done in LateInit -/obj/machinery/modular_computer/preset/cargochat/cargo/LateInitialize() +/obj/machinery/modular_computer/preset/cargochat/cargo/post_machine_initialize() . = ..() var/datum/computer_file/program/chatclient/chatprogram = cpu.find_file_by_name("ntnrc_client") chatprogram.username = "cargo_requests_operator" diff --git a/code/modules/power/lighting/light.dm b/code/modules/power/lighting/light.dm index 86d387a8886..1f98383a6f0 100644 --- a/code/modules/power/lighting/light.dm +++ b/code/modules/power/lighting/light.dm @@ -118,9 +118,8 @@ RegisterSignal(src, COMSIG_HIT_BY_SABOTEUR, PROC_REF(on_saboteur)) AddElement(/datum/element/atmos_sensitive, mapload) find_and_hang_on_wall(custom_drop_callback = CALLBACK(src, PROC_REF(knock_down))) - return INITIALIZE_HINT_LATELOAD -/obj/machinery/light/LateInitialize() +/obj/machinery/light/post_machine_initialize() . = ..() #ifndef MAP_TEST switch(fitting) diff --git a/code/modules/power/turbine/turbine.dm b/code/modules/power/turbine/turbine.dm index 21269c90d37..590b135ad9a 100644 --- a/code/modules/power/turbine/turbine.dm +++ b/code/modules/power/turbine/turbine.dm @@ -43,7 +43,7 @@ register_context() -/obj/machinery/power/turbine/LateInitialize() +/obj/machinery/power/turbine/post_machine_initialize() . = ..() activate_parts() diff --git a/code/modules/power/turbine/turbine_computer.dm b/code/modules/power/turbine/turbine_computer.dm index 9e0f5bdaa46..f983e11c1f1 100644 --- a/code/modules/power/turbine/turbine_computer.dm +++ b/code/modules/power/turbine/turbine_computer.dm @@ -9,11 +9,7 @@ ///Easy way to connect a computer and a turbine roundstart by setting an id on both this and the core_rotor var/mapping_id -/obj/machinery/computer/turbine_computer/Initialize(mapload) - . = ..() - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/computer/turbine_computer/LateInitialize() +/obj/machinery/computer/turbine_computer/post_machine_initialize() . = ..() locate_machinery() diff --git a/code/modules/recycling/conveyor.dm b/code/modules/recycling/conveyor.dm index cb008252037..44ad6bf6da7 100644 --- a/code/modules/recycling/conveyor.dm +++ b/code/modules/recycling/conveyor.dm @@ -37,13 +37,29 @@ GLOBAL_LIST_EMPTY(conveyors_by_id) //Direction -> if we have a conveyor belt in that direction var/list/neighbors -/obj/machinery/conveyor/Initialize(mapload) +/obj/machinery/conveyor/Initialize(mapload, new_dir, new_id) . = ..() AddElement(/datum/element/footstep_override, priority = STEP_SOUND_CONVEYOR_PRIORITY) var/static/list/give_turf_traits = list(TRAIT_TURF_IGNORE_SLOWDOWN) AddElement(/datum/element/give_turf_traits, give_turf_traits) register_context() + if(new_dir) + setDir(new_dir) + if(new_id) + id = new_id + neighbors = list() + ///Leaving onto conveyor detection won't work at this point, but that's alright since it's an optimization anyway + ///Should be fine without it + var/static/list/loc_connections = list( + COMSIG_ATOM_EXITED = PROC_REF(conveyable_exit), + COMSIG_ATOM_ENTERED = PROC_REF(conveyable_enter), + COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON = PROC_REF(conveyable_enter) + ) + AddElement(/datum/element/connect_loc, loc_connections) + update_move_direction() + LAZYADD(GLOB.conveyors_by_id[id], src) + /obj/machinery/conveyor/examine(mob/user) . = ..() if(inverted) @@ -96,27 +112,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id) icon_state = "conveyor_map_inverted" flipped = TRUE -// create a conveyor -/obj/machinery/conveyor/Initialize(mapload, new_dir, new_id) - ..() - if(new_dir) - setDir(new_dir) - if(new_id) - id = new_id - neighbors = list() - ///Leaving onto conveyor detection won't work at this point, but that's alright since it's an optimization anyway - ///Should be fine without it - var/static/list/loc_connections = list( - COMSIG_ATOM_EXITED = PROC_REF(conveyable_exit), - COMSIG_ATOM_ENTERED = PROC_REF(conveyable_enter), - COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON = PROC_REF(conveyable_enter) - ) - AddElement(/datum/element/connect_loc, loc_connections) - update_move_direction() - LAZYADD(GLOB.conveyors_by_id[id], src) - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/conveyor/LateInitialize() +/obj/machinery/conveyor/post_machine_initialize() . = ..() build_neighbors() diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index 93556af0f5f..ce3d9f8975e 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -10,6 +10,7 @@ resistance_flags = FIRE_PROOF interaction_flags_machine = INTERACT_MACHINE_OPEN | INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON obj_flags = CAN_BE_HIT + use_power = NO_POWER_USE /// The internal air reservoir of the disposal var/datum/gas_mixture/air_contents @@ -99,7 +100,8 @@ if(current_size >= STAGE_FIVE) deconstruct() -/obj/machinery/disposal/LateInitialize() +/obj/machinery/disposal/post_machine_initialize() + . = ..() //this will get a copy of the air turf and take a SEND PRESSURE amount of air from it var/atom/L = loc var/datum/gas_mixture/env = new diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index e529f97eb0c..04d0c30d9e0 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -45,7 +45,7 @@ Nothing else in the console has ID requirements. return reagent.name return ID -/obj/machinery/computer/rdconsole/LateInitialize() +/obj/machinery/computer/rdconsole/post_machine_initialize() . = ..() if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research) CONNECT_TO_RND_SERVER_ROUNDSTART(stored_research, src) diff --git a/code/modules/research/rdmachines.dm b/code/modules/research/rdmachines.dm index 58d7f1f29cf..60dcc8716cc 100644 --- a/code/modules/research/rdmachines.dm +++ b/code/modules/research/rdmachines.dm @@ -24,7 +24,7 @@ set_wires(new /datum/wires/rnd(src)) register_context() -/obj/machinery/rnd/LateInitialize() +/obj/machinery/rnd/post_machine_initialize() . = ..() if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research) CONNECT_TO_RND_SERVER_ROUNDSTART(stored_research, src) diff --git a/code/modules/research/server_control.dm b/code/modules/research/server_control.dm index 94a429dc6d7..24327a731a6 100644 --- a/code/modules/research/server_control.dm +++ b/code/modules/research/server_control.dm @@ -9,7 +9,7 @@ ///Connected techweb node the server is connected to. var/datum/techweb/stored_research -/obj/machinery/computer/rdservercontrol/LateInitialize() +/obj/machinery/computer/rdservercontrol/post_machine_initialize() . = ..() if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research) CONNECT_TO_RND_SERVER_ROUNDSTART(stored_research, src) diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index de97ea7bf69..172959153aa 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -58,7 +58,7 @@ stored_slimes = list() -/obj/machinery/computer/camera_advanced/xenobio/LateInitialize(mapload) +/obj/machinery/computer/camera_advanced/xenobio/post_machine_initialize() . = ..() for(var/obj/machinery/monkey_recycler/recycler in GLOB.monkey_recyclers) if(get_area(recycler.loc) == get_area(loc)) diff --git a/code/modules/transport/elevator/elev_indicator.dm b/code/modules/transport/elevator/elev_indicator.dm index 7b34f2d6105..22b9334be5a 100644 --- a/code/modules/transport/elevator/elev_indicator.dm +++ b/code/modules/transport/elevator/elev_indicator.dm @@ -36,11 +36,7 @@ /// The elevator's current floor relative to its lowest floor being 1 var/current_lift_floor = 1 -/obj/machinery/lift_indicator/Initialize(mapload) - . = ..() - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/lift_indicator/LateInitialize() +/obj/machinery/lift_indicator/post_machine_initialize() . = ..() for(var/datum/transport_controller/linear/possible_match as anything in SStransport.transports_by_type[TRANSPORT_TYPE_ELEVATOR]) diff --git a/code/modules/transport/elevator/elev_panel.dm b/code/modules/transport/elevator/elev_panel.dm index 24b6e0fa317..76b95922dfe 100644 --- a/code/modules/transport/elevator/elev_panel.dm +++ b/code/modules/transport/elevator/elev_panel.dm @@ -60,19 +60,15 @@ AddElement(/datum/element/contextual_screentip_tools, tool_behaviors) AddElement(/datum/element/contextual_screentip_bare_hands, lmb_text = "Send Elevator") - // Machinery returns lateload by default via parent, - // this is just here for redundancy's sake. - . = INITIALIZE_HINT_LATELOAD - maploaded = mapload - // Maploaded panels link in LateInitialize... + // Maploaded panels link in post_machine_initialize... if(mapload) return // And non-mapload panels link in Initialize link_with_lift(log_error = FALSE) -/obj/machinery/elevator_control_panel/LateInitialize() +/obj/machinery/elevator_control_panel/post_machine_initialize() . = ..() // If we weren't maploaded, we probably already linked (or tried to link) in Initialize(). if(!maploaded) diff --git a/code/modules/transport/tram/tram_controller.dm b/code/modules/transport/tram/tram_controller.dm index 8f5fae1deea..7912588ab8a 100644 --- a/code/modules/transport/tram/tram_controller.dm +++ b/code/modules/transport/tram/tram_controller.dm @@ -715,12 +715,11 @@ register_context() if(!id_tag) id_tag = assign_random_name() - return INITIALIZE_HINT_LATELOAD /** * Mapped or built tram cabinet isn't located on a transport module. */ -/obj/machinery/transport/tram_controller/LateInitialize(mapload) +/obj/machinery/transport/tram_controller/post_machine_initialize() . = ..() SStransport.hello(src, name, id_tag) find_controller() diff --git a/code/modules/transport/tram/tram_controls.dm b/code/modules/transport/tram/tram_controls.dm index 435b47f9d1b..0bfce56aa5c 100644 --- a/code/modules/transport/tram/tram_controls.dm +++ b/code/modules/transport/tram/tram_controls.dm @@ -54,7 +54,7 @@ var/obj/item/circuitboard/computer/tram_controls/my_circuit = circuit split_mode = my_circuit.split_mode -/obj/machinery/computer/tram_controls/LateInitialize() +/obj/machinery/computer/tram_controls/post_machine_initialize() . = ..() if(!id_tag) id_tag = assign_random_name() diff --git a/code/modules/transport/tram/tram_displays.dm b/code/modules/transport/tram/tram_displays.dm index 47fe21f2ff1..b228bb38e9b 100644 --- a/code/modules/transport/tram/tram_displays.dm +++ b/code/modules/transport/tram/tram_displays.dm @@ -51,7 +51,6 @@ TRAMSTATION_LINE_1, ) set_light(l_dir = REVERSE_DIR(dir)) - return INITIALIZE_HINT_LATELOAD /obj/machinery/transport/destination_sign/Destroy() SStransport.displays -= src @@ -61,7 +60,7 @@ . = ..() set_light(l_dir = REVERSE_DIR(dir)) -/obj/machinery/transport/destination_sign/indicator/LateInitialize(mapload) +/obj/machinery/transport/destination_sign/indicator/post_machine_initialize() . = ..() link_tram() diff --git a/code/modules/transport/tram/tram_doors.dm b/code/modules/transport/tram/tram_doors.dm index 7e21b936791..ea6fe8d32c9 100644 --- a/code/modules/transport/tram/tram_doors.dm +++ b/code/modules/transport/tram/tram_doors.dm @@ -184,7 +184,7 @@ RemoveElement(/datum/element/atmos_sensitive, mapload) return INITIALIZE_HINT_LATELOAD -/obj/machinery/door/airlock/tram/LateInitialize(mapload) +/obj/machinery/door/airlock/tram/post_machine_initialize() . = ..() INVOKE_ASYNC(src, PROC_REF(open)) SStransport.doors += src diff --git a/code/modules/transport/tram/tram_machinery.dm b/code/modules/transport/tram/tram_machinery.dm index 7371447d082..99375bfbaf5 100644 --- a/code/modules/transport/tram/tram_machinery.dm +++ b/code/modules/transport/tram/tram_machinery.dm @@ -37,8 +37,7 @@ . = ..() return INITIALIZE_HINT_LATELOAD -/obj/item/assembly/control/transport/call_button/LateInitialize(mapload) - . = ..() +/obj/item/assembly/control/transport/call_button/LateInitialize() if(!id_tag) id_tag = assign_random_name() SStransport.hello(src, name, id_tag) diff --git a/code/modules/transport/tram/tram_power.dm b/code/modules/transport/tram/tram_power.dm index ff0251e9090..45c48766db8 100644 --- a/code/modules/transport/tram/tram_power.dm +++ b/code/modules/transport/tram/tram_power.dm @@ -15,11 +15,7 @@ /// The tram platform we're connected to and providing power var/obj/effect/landmark/transport/nav_beacon/tram/platform/connected_platform -/obj/machinery/transport/power_rectifier/Initialize(mapload) - . = ..() - return INITIALIZE_HINT_LATELOAD - -/obj/machinery/transport/power_rectifier/LateInitialize(mapload) +/obj/machinery/transport/power_rectifier/post_machine_initialize() . = ..() RegisterSignal(SStransport, COMSIG_TRANSPORT_ACTIVE, PROC_REF(power_tram)) find_platform() diff --git a/code/modules/transport/tram/tram_signals.dm b/code/modules/transport/tram/tram_signals.dm index 101ae1027a3..88f18d2cb7d 100644 --- a/code/modules/transport/tram/tram_signals.dm +++ b/code/modules/transport/tram/tram_signals.dm @@ -107,9 +107,8 @@ RegisterSignal(SStransport, COMSIG_COMMS_STATUS, PROC_REF(comms_change)) SStransport.crossing_signals += src register_context() - return INITIALIZE_HINT_LATELOAD -/obj/machinery/transport/crossing_signal/LateInitialize(mapload) +/obj/machinery/transport/crossing_signal/post_machine_initialize() . = ..() link_tram() link_sensor() @@ -510,9 +509,8 @@ /obj/machinery/transport/guideway_sensor/Initialize(mapload) . = ..() SStransport.sensors += src - return INITIALIZE_HINT_LATELOAD -/obj/machinery/transport/guideway_sensor/LateInitialize(mapload) +/obj/machinery/transport/guideway_sensor/post_machine_initialize() . = ..() pair_sensor() RegisterSignal(SStransport, COMSIG_TRANSPORT_ACTIVE, PROC_REF(wake_up)) diff --git a/code/modules/transport/tram/tram_structures.dm b/code/modules/transport/tram/tram_structures.dm index 74532d87be7..6f0be403c0d 100644 --- a/code/modules/transport/tram/tram_structures.dm +++ b/code/modules/transport/tram/tram_structures.dm @@ -488,7 +488,6 @@ return INITIALIZE_HINT_LATELOAD /obj/structure/tram/spoiler/LateInitialize() - . = ..() RegisterSignal(SStransport, COMSIG_TRANSPORT_ACTIVE, PROC_REF(set_spoiler)) /obj/structure/tram/spoiler/add_context(atom/source, list/context, obj/item/held_item, mob/user) diff --git a/code/modules/transport/transport_module.dm b/code/modules/transport/transport_module.dm index d027cf7ba6d..a2ba6f5167b 100644 --- a/code/modules/transport/transport_module.dm +++ b/code/modules/transport/transport_module.dm @@ -96,7 +96,6 @@ return INITIALIZE_HINT_LATELOAD /obj/structure/transport/linear/LateInitialize() - . = ..() //after everything is initialized the transport controller can order everything transport_controller_datum.order_platforms_by_z_level() diff --git a/code/modules/vehicles/mecha/mech_fabricator.dm b/code/modules/vehicles/mecha/mech_fabricator.dm index 54acd183aff..9fea0ebe82f 100644 --- a/code/modules/vehicles/mecha/mech_fabricator.dm +++ b/code/modules/vehicles/mecha/mech_fabricator.dm @@ -55,7 +55,7 @@ RefreshParts() //Recalculating local material sizes if the fab isn't linked return ..() -/obj/machinery/mecha_part_fabricator/LateInitialize() +/obj/machinery/mecha_part_fabricator/post_machine_initialize() . = ..() if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research) CONNECT_TO_RND_SERVER_ROUNDSTART(stored_research, src) diff --git a/code/modules/wiremod/core/component_printer.dm b/code/modules/wiremod/core/component_printer.dm index 7c691e3a4c4..370a6cfea52 100644 --- a/code/modules/wiremod/core/component_printer.dm +++ b/code/modules/wiremod/core/component_printer.dm @@ -24,7 +24,7 @@ . = ..() materials = AddComponent(/datum/component/remote_materials, mapload) -/obj/machinery/component_printer/LateInitialize() +/obj/machinery/component_printer/post_machine_initialize() . = ..() if(!CONFIG_GET(flag/no_default_techweb_link) && !techweb) CONNECT_TO_RND_SERVER_ROUNDSTART(techweb, src) diff --git a/modular_nova/modules/advanced_shuttles/code/shuttles.dm b/modular_nova/modules/advanced_shuttles/code/shuttles.dm index d90cf2e1a33..a93cc4b96a0 100644 --- a/modular_nova/modules/advanced_shuttles/code/shuttles.dm +++ b/modular_nova/modules/advanced_shuttles/code/shuttles.dm @@ -27,7 +27,6 @@ return INITIALIZE_HINT_LATELOAD /obj/docking_port/mobile/arrivals_nova/LateInitialize() - . = ..() console = get_control_console() /obj/docking_port/mobile/arrivals_nova/check() diff --git a/modular_nova/modules/aesthetics/lightswitch/code/lightswitch.dm b/modular_nova/modules/aesthetics/lightswitch/code/lightswitch.dm index c66af1e7de1..4e35cdc0d0c 100644 --- a/modular_nova/modules/aesthetics/lightswitch/code/lightswitch.dm +++ b/modular_nova/modules/aesthetics/lightswitch/code/lightswitch.dm @@ -6,7 +6,7 @@ playsound(src, 'modular_nova/modules/aesthetics/lightswitch/sound/lightswitch.ogg', 100, 1) #ifndef UNIT_TESTS -/obj/machinery/light_switch/LateInitialize() +/obj/machinery/light_switch/post_machine_initialize() . = ..() if(prob(50) && area.lightswitch) //50% chance for area to start with lights off. turn_off() diff --git a/modular_nova/modules/aesthetics/status_display/code/status_display.dm b/modular_nova/modules/aesthetics/status_display/code/status_display.dm index cfa125c49f0..5a228b41bd1 100644 --- a/modular_nova/modules/aesthetics/status_display/code/status_display.dm +++ b/modular_nova/modules/aesthetics/status_display/code/status_display.dm @@ -1,13 +1,13 @@ /obj/machinery/status_display icon = 'modular_nova/modules/aesthetics/status_display/icons/status_display.dmi' -/obj/machinery/status_display/LateInitialize() +/obj/machinery/status_display/post_machine_initialize() . = ..() set_picture("default") /obj/machinery/status_display/syndie name = "syndicate status display" -/obj/machinery/status_display/syndie/LateInitialize() +/obj/machinery/status_display/syndie/post_machine_initialize() . = ..() set_picture("synd") diff --git a/modular_nova/modules/cryosleep/code/cryopod.dm b/modular_nova/modules/cryosleep/code/cryopod.dm index 9b94af48cac..b841af3dad0 100644 --- a/modular_nova/modules/cryosleep/code/cryopod.dm +++ b/modular_nova/modules/cryosleep/code/cryopod.dm @@ -177,7 +177,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/cryopod, 32) GLOB.valid_cryopods += src return INITIALIZE_HINT_LATELOAD //Gotta populate the cryopod computer GLOB first -/obj/machinery/cryopod/LateInitialize() +/obj/machinery/cryopod/post_machine_initialize() + . = ..() update_icon() find_control_computer() diff --git a/modular_nova/modules/delam_emergency_stop/code/scram.dm b/modular_nova/modules/delam_emergency_stop/code/scram.dm index 03ff3e00eaa..0ad1ede4e49 100644 --- a/modular_nova/modules/delam_emergency_stop/code/scram.dm +++ b/modular_nova/modules/delam_emergency_stop/code/scram.dm @@ -63,7 +63,7 @@ return INITIALIZE_HINT_LATELOAD -/obj/machinery/atmospherics/components/unary/delam_scram/LateInitialize() +/obj/machinery/atmospherics/components/unary/delam_scram/post_machine_initialize() . = ..() if(isnull(id_tag)) id_tag = "SCRAM" @@ -387,7 +387,7 @@ else if(machine_stat & (NOPOWER|BROKEN)) icon_state += "-nopower" -/obj/machinery/power/emitter/LateInitialize(mapload) +/obj/machinery/power/emitter/post_machine_initialize(mapload) . = ..() RegisterSignal(SSdcs, COMSIG_MAIN_SM_DELAMINATING, PROC_REF(emergency_stop)) diff --git a/modular_nova/modules/turretid/code/turret_id_system.dm b/modular_nova/modules/turretid/code/turret_id_system.dm index bae950e5b08..4b7c5ffd170 100644 --- a/modular_nova/modules/turretid/code/turret_id_system.dm +++ b/modular_nova/modules/turretid/code/turret_id_system.dm @@ -20,7 +20,7 @@ GLOBAL_LIST_EMPTY(turret_id_refs) /obj/machinery/turretid var/system_id //The ID system for turrets, will get any turrets with the same ID and put them in controlled turrets -/obj/machinery/turretid/LateInitialize() +/obj/machinery/turretid/post_machine_initialize() . = ..() if(system_id && GLOB.turret_id_refs[system_id]) for(var/i in GLOB.turret_id_refs[system_id])