From 7f083e7cb60c416359bfc875cbb2ce595e39fdb6 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 1 May 2021 10:44:09 +0200 Subject: [PATCH] [MIRROR] Converts the atmos senstive component over to connect_loc (#5376) * Converts the atmos senstive component over to connect_loc (#58266) * Makes all uses of atmos_senstive pass in mapload as context * Converts atmos senstive to connect_loc, does some general cleanup to the element, and makes it check the state of the tile the thing is on assuming creation didn't happen as a part of map loading * Updates connect loc to match the new arg list * Converts the atmos senstive component over to connect_loc Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> --- code/datums/elements/atmos_sensitive.dm | 40 ++++++++++--------- code/game/machinery/doors/airlock_types.dm | 4 +- code/game/machinery/doors/windowdoor.dm | 2 +- code/game/machinery/firealarm.dm | 8 ++-- .../effects/effect_system/effects_foam.dm | 11 ++--- code/game/objects/effects/glowshroom.dm | 5 +-- code/game/objects/effects/spiders.dm | 4 +- code/game/objects/items/latexballoon.dm | 4 +- .../objects/items/stacks/sheets/leather.dm | 5 +-- code/game/objects/items/tanks/jetpack.dm | 1 + code/game/objects/structures/aliens.dm | 12 ++---- code/game/objects/structures/false_walls.dm | 4 +- code/game/objects/structures/grille.dm | 4 +- code/game/objects/structures/mineral_doors.dm | 4 +- code/game/objects/structures/statues.dm | 4 +- code/game/objects/structures/window.dm | 6 +-- .../environmental/LINDA_turf_tile.dm | 2 +- .../machinery/portable/canister.dm | 5 +-- code/modules/clothing/under/accessories.dm | 4 +- code/modules/events/spacevine.dm | 7 +--- .../living/carbon/alien/special/facehugger.dm | 4 +- .../mob/living/simple_animal/bot/firebot.dm | 7 +--- code/modules/power/apc.dm | 6 +-- code/modules/power/lighting.dm | 5 +-- code/modules/vehicles/mecha/_mecha.dm | 6 +-- 25 files changed, 68 insertions(+), 96 deletions(-) diff --git a/code/datums/elements/atmos_sensitive.dm b/code/datums/elements/atmos_sensitive.dm index e052bc6798c..7aee3dd2c19 100644 --- a/code/datums/elements/atmos_sensitive.dm +++ b/code/datums/elements/atmos_sensitive.dm @@ -4,41 +4,46 @@ //Don't put it on things that tend to clump into one spot, you will cause lag spikes. /datum/element/atmos_sensitive element_flags = ELEMENT_DETACH + var/static/list/pass_on = list(COMSIG_TURF_EXPOSE = /atom/proc/check_atmos_process) -/datum/element/atmos_sensitive/Attach(datum/target) +/datum/element/atmos_sensitive/Attach(datum/target, mapload) if(!isatom(target)) //How return ELEMENT_INCOMPATIBLE var/atom/to_track = target - if(isopenturf(to_track.loc)) - to_track.RegisterSignal(to_track.loc, COMSIG_TURF_EXPOSE, /atom/proc/check_atmos_process) - RegisterSignal(to_track, COMSIG_MOVABLE_MOVED, .proc/handle_move) + to_track.AddElement(/datum/element/connect_loc, to_track, pass_on) + RegisterSignal(to_track, COMSIG_MOVABLE_MOVED, .proc/react_to_move) + + if(!mapload && isopenturf(to_track.loc)) + var/turf/open/new_open = to_track.loc + to_track.check_atmos_process(new_open, new_open.air, new_open.air.temperature) //Make sure you're properly registered + return ..() /datum/element/atmos_sensitive/Detach(datum/source) var/atom/us = source - us.UnregisterSignal(get_turf(us), COMSIG_TURF_EXPOSE) + us.RemoveElement(/datum/element/connect_loc, pass_on) if(us.flags_1 & ATMOS_IS_PROCESSING_1) us.atmos_end() SSair.atom_process -= us us.flags_1 &= ~ATMOS_IS_PROCESSING_1 return ..() -/datum/element/atmos_sensitive/proc/handle_move(datum/source, atom/movable/oldloc, direction, forced) - var/atom/microchipped_lad = source - microchipped_lad.UnregisterSignal(oldloc, COMSIG_TURF_EXPOSE) - if(isopenturf(microchipped_lad.loc)) - var/turf/open/new_spot = microchipped_lad.loc - microchipped_lad.RegisterSignal(new_spot, COMSIG_TURF_EXPOSE, /atom/proc/check_atmos_process) - microchipped_lad.check_atmos_process(null, new_spot.air, new_spot.temperature) //Make sure you're properly registered +/datum/element/atmos_sensitive/proc/react_to_move(datum/source, atom/movable/oldloc, direction, forced) + SIGNAL_HANDLER + var/atom/atom_source = source + if(isopenturf(atom_source.loc)) + var/turf/open/new_open = atom_source.loc + atom_source.check_atmos_process(new_open, new_open.air, new_open.air.temperature) //Make sure you're properly registered /atom/proc/check_atmos_process(datum/source, datum/gas_mixture/air, exposed_temperature) + SIGNAL_HANDLER if(should_atmos_process(air, exposed_temperature)) if(flags_1 & ATMOS_IS_PROCESSING_1) return SSair.atom_process += src flags_1 |= ATMOS_IS_PROCESSING_1 else if(flags_1 & ATMOS_IS_PROCESSING_1) - atmos_end(air, exposed_temperature) + atmos_end() SSair.atom_process -= src flags_1 &= ~ATMOS_IS_PROCESSING_1 @@ -51,7 +56,7 @@ flags_1 &= ~ATMOS_IS_PROCESSING_1 return if(!should_atmos_process(spot.air, spot.air.temperature)) //Things can change without a tile becoming active - atmos_end(spot.air, spot.air.temperature) + atmos_end() SSair.atom_process -= src flags_1 &= ~ATMOS_IS_PROCESSING_1 return @@ -59,7 +64,7 @@ /turf/open/process_exposure() if(!should_atmos_process(air, air.temperature)) - atmos_end(air, air.temperature) + atmos_end() SSair.atom_process -= src flags_1 &= ~ATMOS_IS_PROCESSING_1 return @@ -69,11 +74,10 @@ /atom/proc/should_atmos_process(datum/gas_mixture/air, exposed_temperature) return FALSE - ///This is your process() proc /atom/proc/atmos_expose(datum/gas_mixture/air, exposed_temperature) return -///What to do when our requirements are no longer met. Null inputs are possible -/atom/proc/atmos_end(datum/gas_mixture/air, exposed_temperature) +///What to do when our requirements are no longer met +/atom/proc/atmos_end() return diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index 3de50aa6274..8cfdacc603c 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -211,9 +211,9 @@ icon = 'icons/obj/doors/airlocks/station/plasma.dmi' assemblytype = /obj/structure/door_assembly/door_assembly_plasma -/obj/machinery/door/airlock/plasma/ComponentInitialize() +/obj/machinery/door/airlock/plasma/Initialize(mapload) . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/machinery/door/airlock/plasma/proc/ignite(exposed_temperature) if(exposed_temperature > 300) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index c56b06e3a51..8ec8fb71bed 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -47,10 +47,10 @@ ) AddElement(/datum/element/connect_loc, src, loc_connections) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/machinery/door/window/ComponentInitialize() . = ..() - AddElement(/datum/element/atmos_sensitive) AddComponent(/datum/component/ntnet_interface) /obj/machinery/door/window/Destroy() diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 6379461204c..3de4e634efb 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -51,12 +51,10 @@ update_appearance() myarea = get_area(src) LAZYADD(myarea.firealarms, src) + + AddElement(/datum/element/atmos_sensitive, mapload) RegisterSignal(SSsecurity_level, COMSIG_SECURITY_LEVEL_CHANGED, .proc/check_security_level) -/obj/machinery/firealarm/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) - /obj/machinery/firealarm/Destroy() myarea.firereset(src) LAZYREMOVE(myarea.firealarms, src) @@ -138,7 +136,7 @@ update_appearance() alarm() -/obj/machinery/firealarm/atmos_end(datum/gas_mixture/air, exposed_temperature) +/obj/machinery/firealarm/atmos_end() if(!detecting) return if(triggered) diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index 7ecddafae29..7e877f5e684 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -31,8 +31,8 @@ slippery_foam = FALSE var/absorbed_plasma = 0 -/obj/effect/particle_effect/foam/firefighting/ComponentInitialize() - ..() +/obj/effect/particle_effect/foam/firefighting/Initialize(mapload) + . = ..() RemoveElement(/datum/element/atmos_sensitive) /obj/effect/particle_effect/foam/firefighting/process() @@ -89,15 +89,12 @@ /obj/effect/particle_effect/foam/long_life lifetime = 150 -/obj/effect/particle_effect/foam/Initialize() +/obj/effect/particle_effect/foam/Initialize(mapload) . = ..() create_reagents(1000, REAGENT_HOLDER_INSTANT_REACT) //limited by the size of the reagent holder anyway. Works without instant possibly edit in future START_PROCESSING(SSfastprocess, src) playsound(src, 'sound/effects/bubbles2.ogg', 80, TRUE, -3) - -/obj/effect/particle_effect/foam/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/effect/particle_effect/foam/ComponentInitialize() . = ..() diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 75450c71d9a..1f2c60c96cb 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -98,6 +98,7 @@ else //if on the floor, glowshroom on-floor sprite icon_state = base_icon_state + AddElement(/datum/element/atmos_sensitive, mapload) COOLDOWN_START(src, spread_cooldown, rand(min_delay_spread, max_delay_spread)) START_PROCESSING(SSobj, src) @@ -107,10 +108,6 @@ GLOB.glowshrooms-- STOP_PROCESSING(SSobj, src) -/obj/structure/glowshroom/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) - /** * Causes glowshroom spreading across the floor/walls. */ diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index abc2d497f94..b8cd311bb3a 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -7,9 +7,9 @@ density = FALSE max_integrity = 15 -/obj/structure/spider/ComponentInitialize() +/obj/structure/spider/Initialize(mapload) . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/structure/spider/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) if(damage_type == BURN)//the stickiness of the web mutes all attack sounds except fire damage type diff --git a/code/game/objects/items/latexballoon.dm b/code/game/objects/items/latexballoon.dm index 20c4473eae3..41141100ffe 100644 --- a/code/game/objects/items/latexballoon.dm +++ b/code/game/objects/items/latexballoon.dm @@ -11,9 +11,9 @@ var/state var/datum/gas_mixture/air_contents = null -/obj/item/latexballon/ComponentInitialize() +/obj/item/latexballon/Initialize(mapload) . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/item/latexballon/proc/blow(obj/item/tank/tank, mob/user) if (icon_state == "latexballon_bursted") diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index 09f218364be..a28d5686772 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -156,10 +156,7 @@ GLOBAL_LIST_INIT(xeno_recipes, list ( \ /obj/item/stack/sheet/wethide/Initialize(mapload, new_amount, merge = TRUE, list/mat_override=null, mat_amt=1) . = ..() AddElement(/datum/element/dryable, /obj/item/stack/sheet/leather) - -/obj/item/stack/sheet/wethide/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /* * Leather SHeet diff --git a/code/game/objects/items/tanks/jetpack.dm b/code/game/objects/items/tanks/jetpack.dm index 70fb93e3021..1cefcbd6bb3 100644 --- a/code/game/objects/items/tanks/jetpack.dm +++ b/code/game/objects/items/tanks/jetpack.dm @@ -73,6 +73,7 @@ ion_trail.stop() UnregisterSignal(user, COMSIG_MOVABLE_MOVED) UnregisterSignal(user, COMSIG_MOVABLE_PRE_MOVE) + user.remove_movespeed_modifier(/datum/movespeed_modifier/jetpack/fullspeed) /obj/item/tank/jetpack/proc/move_react(mob/user) diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm index b786fc8c747..b2ef81660cd 100644 --- a/code/game/objects/structures/aliens.dm +++ b/code/game/objects/structures/aliens.dm @@ -145,7 +145,7 @@ var/static/list/blacklisted_turfs -/obj/structure/alien/weeds/Initialize() +/obj/structure/alien/weeds/Initialize(mapload) pixel_x = -4 pixel_y = -4 //so the sprites line up right in the map editor @@ -161,6 +161,7 @@ set_base_icon() last_expand = world.time + rand(growth_cooldown_low, growth_cooldown_high) + AddElement(/datum/element/atmos_sensitive, mapload) ///Randomizes the weeds' starting icon, gets redefined by children for them not to share the behavior. @@ -178,11 +179,6 @@ base_icon_state = "weeds3" set_smoothed_icon_state(smoothing_junction) - -/obj/structure/alien/weeds/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) - /obj/structure/alien/weeds/proc/expand() var/turf/U = get_turf(src) if(is_type_in_typecache(U, blacklisted_turfs)) @@ -286,9 +282,7 @@ if(status == BURST) obj_integrity = integrity_failure * max_integrity -/obj/structure/alien/egg/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/structure/alien/egg/update_icon_state() switch(status) diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index 012dbad0518..3072a9ce800 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -244,9 +244,9 @@ smoothing_groups = list(SMOOTH_GROUP_WALLS, SMOOTH_GROUP_PLASMA_WALLS) canSmoothWith = list(SMOOTH_GROUP_PLASMA_WALLS) -/obj/structure/falsewall/plasma/ComponentInitialize() +/obj/structure/falsewall/plasma/Initialize(mapload) . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/structure/falsewall/plasma/attackby(obj/item/W, mob/user, params) if(W.get_temperature() > 300) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index a4f675c1c19..09ae159ffd1 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -18,9 +18,9 @@ var/grille_type = null var/broken_type = /obj/structure/grille/broken -/obj/structure/grille/ComponentInitialize() +/obj/structure/grille/Initialize(mapload) . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/structure/grille/Destroy() update_cable_icons_on_turf(get_turf(src)) diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index 17dcf76632d..5e374e62746 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -249,9 +249,9 @@ icon_state = "plasma" sheetType = /obj/item/stack/sheet/mineral/plasma -/obj/structure/mineral_door/transparent/plasma/ComponentInitialize() +/obj/structure/mineral_door/transparent/plasma/Initialize(mapload) . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/structure/mineral_door/transparent/plasma/welder_act(mob/living/user, obj/item/I) return diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm index 724c15b5062..04e4e3d0814 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -91,9 +91,9 @@ name = "statue of a scientist" icon_state = "sci" -/obj/structure/statue/plasma/ComponentInitialize() +/obj/structure/statue/plasma/Initialize(mapload) . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/structure/statue/plasma/bullet_act(obj/projectile/Proj) var/burn = FALSE diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 911a3b9db65..b905a99d60e 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -67,6 +67,7 @@ flags_1 |= ALLOW_DARK_PAINTS_1 RegisterSignal(src, COMSIG_OBJ_PAINTED, .proc/on_painted) + AddElement(/datum/element/atmos_sensitive, mapload) var/static/list/loc_connections = list( COMSIG_ATOM_EXIT = .proc/on_exit, @@ -77,8 +78,7 @@ /obj/structure/window/ComponentInitialize() . = ..() - AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS ,null,CALLBACK(src, .proc/can_be_rotated),CALLBACK(src,.proc/after_rotation)) - AddElement(/datum/element/atmos_sensitive) + AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS ,null,CALLBACK(src, .proc/can_be_rotated),CALLBACK(src,.proc/after_rotation)) /obj/structure/window/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) switch(the_rcd.mode) @@ -498,7 +498,7 @@ glass_type = /obj/item/stack/sheet/plasmaglass rad_insulation = RAD_NO_INSULATION -/obj/structure/window/plasma/ComponentInitialize() +/obj/structure/window/plasma/Initialize(mapload, direct) . = ..() RemoveElement(/datum/element/atmos_sensitive) diff --git a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm index e501ef607a4..30d0ba1dcd7 100644 --- a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm +++ b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm @@ -125,7 +125,7 @@ /turf/open/temperature_expose(datum/gas_mixture/air, exposed_temperature) SEND_SIGNAL(src, COMSIG_TURF_EXPOSE, air, exposed_temperature) - check_atmos_process(null, air, exposed_temperature) //Manually do this to avoid needing to use elements, don't want 200 second atom init times + check_atmos_process(src, air, exposed_temperature) //Manually do this to avoid needing to use elements, don't want 200 second atom init times /turf/proc/archive() temperature_archived = temperature diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index efef3d46c72..48506769d06 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -103,10 +103,7 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) pressure_limit = initial(pressure_limit) * (1 + 0.2 * random_quality) update_appearance() - -/obj/machinery/portable_atmospherics/canister/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/machinery/portable_atmospherics/canister/interact(mob/user) . = ..() diff --git a/code/modules/clothing/under/accessories.dm b/code/modules/clothing/under/accessories.dm index dff486c4b81..c7168689723 100644 --- a/code/modules/clothing/under/accessories.dm +++ b/code/modules/clothing/under/accessories.dm @@ -223,9 +223,9 @@ armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = -10, ACID = 0) //It's made of plasma. Of course it's flammable. custom_materials = list(/datum/material/plasma=1000) -/obj/item/clothing/accessory/medal/plasma/ComponentInitialize() +/obj/item/clothing/accessory/medal/plasma/Initialize(mapload) . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/item/clothing/accessory/medal/plasma/should_atmos_process(datum/gas_mixture/air, exposed_temperature) return exposed_temperature > 300 diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 559c6cd6204..1eacb5c7bcd 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -332,13 +332,10 @@ var/datum/spacevine_controller/master = null var/list/mutations = list() -/obj/structure/spacevine/Initialize() +/obj/structure/spacevine/Initialize(mapload) . = ..() add_atom_colour("#ffffff", FIXED_COLOUR_PRIORITY) - -/obj/structure/spacevine/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/structure/spacevine/examine(mob/user) . = ..() diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 3e6bcfd701d..7d7bd7cfa88 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -35,9 +35,9 @@ var/attached = 0 -/obj/item/clothing/mask/facehugger/ComponentInitialize() +/obj/item/clothing/mask/facehugger/Initialize(mapload) . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/item/clothing/mask/facehugger/lamarr name = "Lamarr" diff --git a/code/modules/mob/living/simple_animal/bot/firebot.dm b/code/modules/mob/living/simple_animal/bot/firebot.dm index 4bcb7045032..9eaa13a9a8d 100644 --- a/code/modules/mob/living/simple_animal/bot/firebot.dm +++ b/code/modules/mob/living/simple_animal/bot/firebot.dm @@ -38,7 +38,7 @@ var/extinguish_fires = TRUE var/stationary_mode = FALSE -/mob/living/simple_animal/bot/firebot/Initialize() +/mob/living/simple_animal/bot/firebot/Initialize(mapload) . = ..() ADD_TRAIT(src, TRAIT_SPACEWALK, INNATE_TRAIT) update_appearance(UPDATE_ICON) @@ -49,10 +49,7 @@ prev_access = access_card.access.Copy() create_extinguisher() - -/mob/living/simple_animal/bot/firebot/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /mob/living/simple_animal/bot/firebot/bot_reset() create_extinguisher() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 2e92c3570c9..fb73c746fdb 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -284,6 +284,8 @@ /obj/machinery/power/apc/Initialize(mapload) . = ..() + AddElement(/datum/element/atmos_sensitive, mapload) + if(!mapload) return has_electronics = APC_ELECTRONICS_SECURED @@ -312,10 +314,6 @@ addtimer(CALLBACK(src, .proc/update), 5) -/obj/machinery/power/apc/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) - /obj/machinery/power/apc/should_atmos_process(datum/gas_mixture/air, exposed_temperature) return (exposed_temperature > 2000) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 9f0dda0a5c6..ffc1789ff69 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -357,6 +357,7 @@ cell = new/obj/item/stock_parts/cell/emergency_light(src) RegisterSignal(src, COMSIG_LIGHT_EATER_ACT, .proc/on_light_eater) + AddElement(/datum/element/atmos_sensitive, mapload) return INITIALIZE_HINT_LATELOAD /obj/machinery/light/LateInitialize() @@ -372,10 +373,6 @@ break_light_tube(1) addtimer(CALLBACK(src, .proc/update, 0), 1) -/obj/machinery/light/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) - /obj/machinery/light/Destroy() var/area/A = get_area(src) if(A) diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index f5ca4dea73b..d4cd9f26a96 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -173,7 +173,7 @@ /obj/item/radio/mech //this has to go somewhere subspace_transmission = TRUE -/obj/vehicle/sealed/mecha/Initialize() +/obj/vehicle/sealed/mecha/Initialize(mapload) . = ..() if(enclosed) internal_tank = new (src) @@ -212,9 +212,7 @@ diag_hud_set_mechstat() update_appearance() -/obj/mecha/ComponentInitialize() - . = ..() - AddElement(/datum/element/atmos_sensitive) + AddElement(/datum/element/atmos_sensitive, mapload) /obj/vehicle/sealed/mecha/Destroy() for(var/ejectee in occupants)