From 550e76343373f962f8ec1e3e5b56110d2d647877 Mon Sep 17 00:00:00 2001 From: TiviPlus <57223640+TiviPlus@users.noreply.github.com> Date: Sat, 5 Sep 2020 01:44:08 +0200 Subject: [PATCH] Reenables SHOULD_NOT_SLEEP on initialize (#53378) --- code/datums/brain_damage/imaginary_friend.dm | 2 +- code/datums/holocall.dm | 2 +- code/datums/mind.dm | 2 +- code/game/atoms.dm | 2 +- code/game/machinery/computer/arena.dm | 2 +- code/game/machinery/doors/alarmlock.dm | 2 +- code/game/machinery/slotmachine.dm | 4 ++-- code/game/objects/effects/anomalies.dm | 2 +- code/game/objects/items/stacks/stack.dm | 2 +- code/modules/awaymissions/corpse.dm | 2 +- code/modules/clothing/head/helmet.dm | 1 - code/modules/fields/fields.dm | 4 ++-- code/modules/fields/timestop.dm | 2 +- code/modules/mapping/map_template.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 4 ++-- code/modules/mob/living/silicon/ai/ai.dm | 2 +- code/modules/mob/living/silicon/robot/robot.dm | 4 ++-- .../modules/mob/living/simple_animal/hostile/jungle/leaper.dm | 2 +- .../hostile/mining_mobs/elites/goliath_broodmother.dm | 3 +++ code/modules/mob/living/simple_animal/hostile/regalrat.dm | 3 +++ code/modules/mob/living/simple_animal/hostile/zombie.dm | 2 +- code/modules/vehicles/mecha/mecha_wreckage.dm | 2 +- 22 files changed, 29 insertions(+), 24 deletions(-) diff --git a/code/datums/brain_damage/imaginary_friend.dm b/code/datums/brain_damage/imaginary_friend.dm index 0369b52343e..825f7748cd2 100644 --- a/code/datums/brain_damage/imaginary_friend.dm +++ b/code/datums/brain_damage/imaginary_friend.dm @@ -94,7 +94,7 @@ trauma = _trauma owner = trauma.owner - setup_friend() + INVOKE_ASYNC(src, .proc/setup_friend) join = new join.Grant(src) diff --git a/code/datums/holocall.dm b/code/datums/holocall.dm index 1a788f77984..49f96805e0f 100644 --- a/code/datums/holocall.dm +++ b/code/datums/holocall.dm @@ -237,7 +237,7 @@ /obj/item/disk/holodisk/Initialize(mapload) . = ..() if(preset_record_text) - build_record() + INVOKE_ASYNC(src, .proc/build_record) /obj/item/disk/holodisk/Destroy() QDEL_NULL(record) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 562882b03dd..349ca2fd2ae 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -258,7 +258,7 @@ var/datum/team/antag_team = A.get_team() if(antag_team) antag_team.add_member(src) - A.on_gain() + INVOKE_ASYNC(A, /datum/antagonist.proc/on_gain) log_game("[key_name(src)] has gained antag datum [A.name]([A.type])") return A diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 325901f99c8..1d9584981b6 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -195,7 +195,7 @@ * * [/turf/open/space/Initialize] */ /atom/proc/Initialize(mapload, ...) - //SHOULD_NOT_SLEEP(TRUE) + SHOULD_NOT_SLEEP(TRUE) SHOULD_CALL_PARENT(TRUE) if(flags_1 & INITIALIZED_1) stack_trace("Warning: [src]([type]) initialized multiple times!") diff --git a/code/game/machinery/computer/arena.dm b/code/game/machinery/computer/arena.dm index fd0236eb519..ca7b253e8b5 100644 --- a/code/game/machinery/computer/arena.dm +++ b/code/game/machinery/computer/arena.dm @@ -88,7 +88,7 @@ var/list/default_arenas = flist(arena_dir) for(var/arena_file in default_arenas) var/simple_name = replacetext(replacetext(arena_file,arena_dir,""),".dmm","") - add_new_arena_template(null,arena_dir + arena_file,simple_name) + INVOKE_ASYNC(src, .proc/add_new_arena_template, null, arena_dir + arena_file, simple_name) /obj/machinery/computer/arena/proc/get_landmark_turf(landmark_tag) for(var/obj/effect/landmark/arena/L in GLOB.landmarks_list) diff --git a/code/game/machinery/doors/alarmlock.dm b/code/game/machinery/doors/alarmlock.dm index 41389e8c00f..3fc9a30033c 100644 --- a/code/game/machinery/doors/alarmlock.dm +++ b/code/game/machinery/doors/alarmlock.dm @@ -23,7 +23,7 @@ . = ..() SSradio.remove_object(src, air_frequency) air_connection = SSradio.add_object(src, air_frequency, RADIO_TO_AIRALARM) - open() + INVOKE_ASYNC(src, .proc/open) /obj/machinery/door/airlock/alarmlock/receive_signal(datum/signal/signal) ..() diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index f989b6ceed5..6cf7413d71c 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -41,13 +41,13 @@ jackpots = rand(1, 4) //false hope plays = rand(75, 200) - toggle_reel_spin(1) //The reels won't spin unless we activate them + INVOKE_ASYNC(src, .proc/toggle_reel_spin, TRUE)//The reels won't spin unless we activate them var/list/reel = reels[1] for(var/i = 0, i < reel.len, i++) //Populate the reels. randomize_reels() - toggle_reel_spin(0) + INVOKE_ASYNC(src, .proc/toggle_reel_spin, FALSE) for(cointype in typesof(/obj/item/coin)) var/obj/item/coin/C = new cointype diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index da11b2a7488..cb6de2ed016 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -141,7 +141,7 @@ /obj/effect/anomaly/grav/high/Initialize(mapload, new_lifespan) . = ..() - setup_grav_field() + INVOKE_ASYNC(src, .proc/setup_grav_field) /obj/effect/anomaly/grav/high/proc/setup_grav_field() grav_field = make_field(/datum/proximity_monitor/advanced/gravity, list("current_range" = 7, "host" = src, "gravity_value" = rand(0,3))) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 376c424e7f4..712347fe935 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -70,7 +70,7 @@ if(merge) for(var/obj/item/stack/S in loc) if(S.merge_type == merge_type) - merge(S) + INVOKE_ASYNC(src, .proc/merge, S) var/list/temp_recipes = get_main_recipes() recipes = temp_recipes.Copy() if(material_type) diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index d4480c422b7..1a7d18f2c06 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -63,7 +63,7 @@ /obj/effect/mob_spawn/Initialize(mapload) . = ..() if(instant || (roundstart && (mapload || (SSticker && SSticker.current_state > GAME_STATE_SETTING_UP)))) - create() + INVOKE_ASYNC(src, .proc/create) else if(ghost_usable) GLOB.poi_list |= src LAZYADD(GLOB.mob_spawners[name], src) diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 0fa5e1df61a..33bb9eb13c0 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -146,7 +146,6 @@ if(active_sound) while(up) playsound(src, "[active_sound]", 100, FALSE, 4) - sleep(15) /obj/item/clothing/head/helmet/justice name = "helmet of justice" diff --git a/code/modules/fields/fields.dm b/code/modules/fields/fields.dm index c45df2c0097..52449bad79e 100644 --- a/code/modules/fields/fields.dm +++ b/code/modules/fields/fields.dm @@ -16,7 +16,7 @@ if(!F.check_variables() && !override_checks) QDEL_NULL(F) if(start_field && (F || override_checks)) - F.Initialize() + F.begin_field() return F /datum/proximity_monitor/advanced @@ -82,7 +82,7 @@ if(requires_processing) START_PROCESSING(SSfields, src) -/datum/proximity_monitor/advanced/proc/Initialize() +/datum/proximity_monitor/advanced/proc/begin_field() setup_field() post_setup_field() diff --git a/code/modules/fields/timestop.dm b/code/modules/fields/timestop.dm index 9908316020e..ec4cc4d2d36 100644 --- a/code/modules/fields/timestop.dm +++ b/code/modules/fields/timestop.dm @@ -33,7 +33,7 @@ if(G.summoner && locate(/obj/effect/proc_holder/spell/aoe_turf/timestop) in G.summoner.mind.spell_list) //It would only make sense that a person's stand would also be immune. immune[G] = TRUE if(start) - timestop() + INVOKE_ASYNC(src, .proc/timestop) /obj/effect/timestop/Destroy() qdel(chronofield) diff --git a/code/modules/mapping/map_template.dm b/code/modules/mapping/map_template.dm index 7662461628a..13957862070 100644 --- a/code/modules/mapping/map_template.dm +++ b/code/modules/mapping/map_template.dm @@ -11,7 +11,7 @@ if(path) mappath = path if(mappath) - preload_size(mappath, cache) + INVOKE_ASYNC(src, .proc/preload_size, mappath, cache) if(rename) name = rename diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index f2fd5f07d81..95814d9dc70 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -10,7 +10,7 @@ setup_human_dna() if(dna.species) - set_species(dna.species.type) + INVOKE_ASYNC(src, .proc/set_species, dna.species.type) //initialise organs create_internal_organs() //most of it is done in set_species now, this is only for parent call @@ -1200,7 +1200,7 @@ /mob/living/carbon/human/species/Initialize() . = ..() - set_species(race) + INVOKE_ASYNC(src, .proc/set_species, race) /mob/living/carbon/human/species/abductor race = /datum/species/abductor diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 28cdee0c2fa..3ada854099e 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -135,7 +135,7 @@ create_eye() if(client) - apply_pref_name("ai",client) + INVOKE_ASYNC(src, .proc/apply_pref_name,"ai",client) set_core_display_icon() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 171d0a84e19..bb6ecfe8558 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -155,7 +155,7 @@ mmi.brainmob.container = mmi mmi.update_icon() - updatename() + INVOKE_ASYNC(src, .proc/updatename) playsound(loc, 'sound/voice/liveagain.ogg', 75, TRUE) aicamera = new/obj/item/camera/siliconcam/robot_camera(src) @@ -880,7 +880,7 @@ hat_offset = module.hat_offset magpulse = module.magpulsing - updatename() + INVOKE_ASYNC(src, .proc/updatename) /mob/living/silicon/robot/proc/place_on_head(obj/item/new_hat) diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm index 7a367ff3dc1..0c5506ab0a0 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm @@ -80,7 +80,7 @@ /obj/structure/leaper_bubble/Initialize() . = ..() - float(on = TRUE) + INVOKE_ASYNC(src, /atom/movable.proc/float, TRUE) QDEL_IN(src, 100) /obj/structure/leaper_bubble/Destroy() diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm index b93ac35f374..1892aea3b7e 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/goliath_broodmother.dm @@ -220,6 +220,9 @@ /obj/effect/temp_visual/goliath_tentacle/broodmother/patch/Initialize(mapload, new_spawner) . = ..() + INVOKE_ASYNC(src, .proc/createpatch) + +/obj/effect/temp_visual/goliath_tentacle/broodmother/patch/proc/createpatch() var/tentacle_locs = spiral_range_turfs(1, get_turf(src)) for(var/T in tentacle_locs) new /obj/effect/temp_visual/goliath_tentacle/broodmother(T, spawner) diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index 6512ccd9b51..0314b585284 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -36,6 +36,9 @@ riot = new /datum/action/cooldown/riot coffer.Grant(src) riot.Grant(src) + INVOKE_ASYNC(src, .proc/get_player) + +/mob/living/simple_animal/hostile/regalrat/proc/get_player() var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you want to play as the Royal Rat, cheesey be his crown?", ROLE_SENTIENCE, null, FALSE, 100, POLL_IGNORE_SENTIENCE_POTION) if(LAZYLEN(candidates) && !mind) var/mob/dead/observer/C = pick(candidates) diff --git a/code/modules/mob/living/simple_animal/hostile/zombie.dm b/code/modules/mob/living/simple_animal/hostile/zombie.dm index 402bb278098..6d3e5f1505b 100644 --- a/code/modules/mob/living/simple_animal/hostile/zombie.dm +++ b/code/modules/mob/living/simple_animal/hostile/zombie.dm @@ -26,7 +26,7 @@ /mob/living/simple_animal/hostile/zombie/Initialize(mapload) . = ..() - setup_visuals() + INVOKE_ASYNC(src, .proc/setup_visuals) /mob/living/simple_animal/hostile/zombie/proc/setup_visuals() var/datum/preferences/dummy_prefs = new diff --git a/code/modules/vehicles/mecha/mecha_wreckage.dm b/code/modules/vehicles/mecha/mecha_wreckage.dm index 1179b19c086..c70d711560f 100644 --- a/code/modules/vehicles/mecha/mecha_wreckage.dm +++ b/code/modules/vehicles/mecha/mecha_wreckage.dm @@ -32,7 +32,7 @@ return AI = AI_pilot AI.apply_damage(150, BURN) //Give the AI a bit of damage from the "shock" of being suddenly shut down - AI.death() //The damage is not enough to kill the AI, but to be 'corrupted files' in need of repair. + INVOKE_ASYNC(AI, /mob/living/silicon.proc/death) //The damage is not enough to kill the AI, but to be 'corrupted files' in need of repair. AI.forceMove(src) //Put the dead AI inside the wreckage for recovery add_overlay(mutable_appearance('icons/obj/projectiles.dmi', "green_laser")) //Overlay for the recovery beacon AI.controlled_mech = null