diff --git a/code/___linters/spaceman_dmm.dm b/code/___linters/spaceman_dmm.dm index 247d28d359c..fec95b9d822 100644 --- a/code/___linters/spaceman_dmm.dm +++ b/code/___linters/spaceman_dmm.dm @@ -3,17 +3,71 @@ // The SPACEMAN_DMM define is set by the linter and other tooling when it runs. #ifdef SPACEMAN_DMM + /** + * Sets a return type expression for a proc. The return type can take the forms: + + * `/typepath` - a raw typepath. The return type of the proc is the type named. + + * `param` - a typepath given as a parameter, for procs which return an instance of the passed-in type. + + * `param.type` - the static type of a passed-in parameter, for procs which + * return their input or otherwise another value of the same type. + + * `param[_].type` - the static type of a passed-in parameter, with one level + * of `/list` stripped, for procs which select one item from a list. The `[_]` + * may be repeated to strip more levels of `/list`. + */ #define RETURN_TYPE(X) set SpacemanDMM_return_type = X + + /** + * If set, will enable a diagnostic on children of the proc it is set on which do + * not contain any `..()` parent calls. This can help with finding situations + * where a signal or other important handling in the parent proc is being skipped. + * Child procs may set this setting to `0` instead to override the check. + */ #define SHOULD_CALL_PARENT(X) set SpacemanDMM_should_call_parent = X - #define UNLINT(X) SpacemanDMM_unlint(X) + + /** + * If set, raise a warning for any child procs that override this one, + * regardless of if it calls parent or not. + * This functions in a similar way to the `final` keyword in some languages. + * This cannot be disabled by child overrides. + */ #define SHOULD_NOT_OVERRIDE(X) set SpacemanDMM_should_not_override = X + + /** + * If set, raise a warning if the proc or one of the sub-procs it calls + * uses a blocking call, such as `sleep()` or `input()` without using `set waitfor = 0` + * This cannot be disabled by child overrides. + */ #define SHOULD_NOT_SLEEP(X) set SpacemanDMM_should_not_sleep = X + + /** + * If set, ensure a proc is 'pure', such that it does not make any changes + * outside itself or output. This also checks to make sure anything using + * this proc doesn't invoke it without making use of the return value. + * This cannot be disabled by child overrides. + */ #define SHOULD_BE_PURE(X) set SpacemanDMM_should_be_pure = X + + ///Private procs can only be called by things of exactly the same type. #define PRIVATE_PROC(X) set SpacemanDMM_private_proc = X + + ///Protected procs can only be call by things of the same type *or subtypes*. #define PROTECTED_PROC(X) set SpacemanDMM_protected_proc = X + + ///If wrapped in this, will not lint. + #define UNLINT(X) SpacemanDMM_unlint(X) + + ///If set, overriding their value isn't permitted by types that inherit it. #define VAR_FINAL var/SpacemanDMM_final + + ///Private vars can only be called by things of exactly the same type. #define VAR_PRIVATE var/SpacemanDMM_private + + ///Protected vars can only be called by things of the same type *or subtypes*. #define VAR_PROTECTED var/SpacemanDMM_protected + #else #define RETURN_TYPE(X) #define SHOULD_CALL_PARENT(X) diff --git a/code/__defines/byond_compat.dm b/code/__defines/byond_compat.dm index d9e8c384ee1..21fe5b62a2c 100644 --- a/code/__defines/byond_compat.dm +++ b/code/__defines/byond_compat.dm @@ -7,17 +7,51 @@ // So we want to have compile time guarantees these procs exist on local type, unfortunately 515 killed the .proc/procname syntax so we have to use nameof() #if DM_VERSION < 515 -/// Call by name proc reference, checks if the proc exists on this type or as a global proc -#define PROC_REF(X) (.proc/##X) -/// Call by name proc reference, checks if the proc exists on given type or as a global proc -#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X) -/// Call by name proc reference, checks if the proc is existing global proc -#define GLOBAL_PROC_REF(X) (/proc/##X) + + /** + * Call by name proc reference, checks if the proc exists on this type or as a global proc + * + * * X - The proc name + */ + #define PROC_REF(X) (.proc/##X) + + /** + * Call by name proc reference, checks if the proc exists on given type or as a global proc + * + * * TYPE - The type (eg. `/datum/something` or `/atom`), without trailing slash + * * X - The proc name + */ + #define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X) + + /** + * Call by name proc reference, checks if the proc is existing global proc + * + * * X - The proc name + */ + #define GLOBAL_PROC_REF(X) (/proc/##X) + #else -/// Call by name proc reference, checks if the proc exists on this type or as a global proc -#define PROC_REF(X) (nameof(.proc/##X)) -/// Call by name proc reference, checks if the proc exists on given type or as a global proc -#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X)) -/// Call by name proc reference, checks if the proc is existing global proc -#define GLOBAL_PROC_REF(X) (/proc/##X) -#endif \ No newline at end of file + + /** + * Call by name proc reference, checks if the proc exists on this type or as a global proc + * + * * X - The proc name + */ + #define PROC_REF(X) (nameof(.proc/##X)) + + /** + * Call by name proc reference, checks if the proc exists on given type or as a global proc + * + * * TYPE - The type (eg. `/datum/something` or `/atom`), without trailing slash + * * X - The proc name + */ + #define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X)) + + /** + * Call by name proc reference, checks if the proc is existing global proc + * + * * X - The proc name + */ + #define GLOBAL_PROC_REF(X) (/proc/##X) + +#endif diff --git a/code/__defines/callback.dm b/code/__defines/callback.dm index 8649e131ded..4ed0d542b84 100644 --- a/code/__defines/callback.dm +++ b/code/__defines/callback.dm @@ -1,2 +1,3 @@ #define CALLBACK new /datum/callback + #define INVOKE_ASYNC ImmediateInvokeAsync diff --git a/code/datums/callback.dm b/code/datums/callback.dm index 84c99cb1f49..7555cc89f5c 100644 --- a/code/datums/callback.dm +++ b/code/datums/callback.dm @@ -13,6 +13,15 @@ if (length(args) > 2) arguments = args.Copy(3) +/** + * Runs a function asynchronously, setting the waitfor to zero + * + * In case of sleeps, the parent proc (aka where you call this) will continue its processing while the called proc sleeps + * + * * thingtocall - The object whose function is to be called on, will be set as `src` in said function, or `GLOBAL_PROC` if the proc is a global one + * * proctocall - The process to call, use `PROC_REF`, `TYPE_PROC_REF` or `GLOBAL_PROC_REF` according to your use case. Defines in code\__defines\byond_compat.dm + * * ... - Parameters to pass to said proc (VARIPARAM) + */ /proc/ImmediateInvokeAsync(thingtocall, proctocall, ...) set waitfor = FALSE diff --git a/code/game/atoms_init.dm b/code/game/atoms_init.dm index 4a18b401335..2cac8996f5d 100644 --- a/code/game/atoms_init.dm +++ b/code/game/atoms_init.dm @@ -21,6 +21,9 @@ created += src /atom/proc/Initialize(mapload, ...) + SHOULD_CALL_PARENT(TRUE) + SHOULD_NOT_SLEEP(TRUE) + if(initialized) crash_with("Warning: [src]([type]) initialized multiple times!") initialized = TRUE diff --git a/code/game/gamemodes/changeling/implements/powers/body.dm b/code/game/gamemodes/changeling/implements/powers/body.dm index 9ff9ecc88cd..73237adfb90 100644 --- a/code/game/gamemodes/changeling/implements/powers/body.dm +++ b/code/game/gamemodes/changeling/implements/powers/body.dm @@ -566,6 +566,7 @@ for(var/obj/machinery/light/L in view(7)) L.broken() + CHECK_TICK playsound(src.loc, 'sound/effects/creepyshriek.ogg', 100, 1) diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm index 954ec64c97e..8e52d8d2cb0 100644 --- a/code/game/gamemodes/vampire/vampire_powers.dm +++ b/code/game/gamemodes/vampire/vampire_powers.dm @@ -379,6 +379,7 @@ for(var/obj/machinery/light/L in view(7)) L.broken() + CHECK_TICK playsound(src.loc, 'sound/effects/creepyshriek.ogg', 100, 1) vampire.use_blood(90) diff --git a/code/game/machinery/computer/slotmachine.dm b/code/game/machinery/computer/slotmachine.dm index 151c1b8a26d..d35b8869517 100644 --- a/code/game/machinery/computer/slotmachine.dm +++ b/code/game/machinery/computer/slotmachine.dm @@ -244,12 +244,15 @@ return FALSE return TRUE -/obj/machinery/computer/slot_machine/proc/toggle_reel_spin(value, delay = 0) //value is 1 or 0 aka on or off +/obj/machinery/computer/slot_machine/proc/toggle_reel_spin(value) //value is 1 or 0 aka on or off for(var/list/reel in reels) reels[reel] = value - if(delay) - sleep(delay) +/obj/machinery/computer/slot_machine/proc/toggle_reel_spin_delay(value, delay = 0) //value is 1 or 0 aka on or off + toggle_reel_spin(value) + + if(delay) + sleep(delay) /obj/machinery/computer/slot_machine/proc/randomize_reels() for(var/reel in reels) diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 803e7de61e9..3057a5fb151 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -224,7 +224,8 @@ update_icon() if(isContactLevel(z)) - set_security_level(security_level ? get_security_level() : "green") + INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(set_security_level), (security_level ? get_security_level() : "green")) + soundloop = new(src, FALSE) var/area/A = get_area(src) diff --git a/code/game/machinery/station_holomap.dm b/code/game/machinery/station_holomap.dm index 7bb393592c6..e61d99c0e3f 100644 --- a/code/game/machinery/station_holomap.dm +++ b/code/game/machinery/station_holomap.dm @@ -198,6 +198,7 @@ active_power_usage = 0 /obj/machinery/station_map/mobile/Initialize() + SHOULD_CALL_PARENT(FALSE) init_map() initialized = TRUE diff --git a/code/game/objects/effects/decals/Cleanable/fuel.dm b/code/game/objects/effects/decals/Cleanable/fuel.dm index 166f39eadcb..9c6fd0d870f 100644 --- a/code/game/objects/effects/decals/Cleanable/fuel.dm +++ b/code/game/objects/effects/decals/Cleanable/fuel.dm @@ -119,6 +119,7 @@ var/amount = 1 /obj/effect/decal/cleanable/foam/Initialize(mapload, amt = 1, nologs = 0) + SHOULD_CALL_PARENT(FALSE) src.amount = amt var/has_spread = 0 diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 234e259a9f9..4021953549e 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -412,6 +412,8 @@ pixel_x = 8; add_overlay(screen_overlays["intercom_l"]) /obj/item/device/radio/intercom/broadcasting/Initialize() + SHOULD_CALL_PARENT(FALSE) + set_broadcasting(TRUE) initialized = TRUE diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index a73a2662c9f..1dcda238074 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -98,9 +98,7 @@ slip_stun = 4 if(M.slip("the [floor_type] floor",slip_stun) && slip_dist) - for (var/i in 1 to slip_dist) - sleep(1) - step(M, M.dir) + INVOKE_ASYNC(src, PROC_REF(slip_mob), M, slip_dist) if(M.lying) return ..() @@ -116,6 +114,19 @@ ..(A, OL) +/** + * Slips a mob, moving it for N tiles + * + * Should be called asyncronously, as this process sleep + * + * * mob_to_slip - The mob that should be slipped + * * slip_distance - How many tiles to slip the mob for + */ +/turf/simulated/proc/slip_mob(var/mob/mob_to_slip, var/slip_distance) + for (var/i in 1 to slip_distance) + sleep(1) + step(mob_to_slip, mob_to_slip.dir) + //returns TRUE if made bloody, returns FALSE otherwise /turf/simulated/add_blood(mob/living/carbon/human/M as mob) if (!..()) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index ce14310b461..ba4622baaf1 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -123,7 +123,7 @@ plant.update_icon() plant.pixel_x = 0 plant.pixel_y = 0 - plant.update_neighbors() + INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/effect/plant, update_neighbors)) /turf/simulated/wall/ChangeTurf(var/newtype) clear_plants() @@ -209,7 +209,7 @@ else O.forceMove(src) - clear_plants() + INVOKE_ASYNC(src, PROC_REF(clear_plants)) clear_bulletholes() material = SSmaterials.get_material_by_name("placeholder") reinf_material = null diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 2d095343f36..5e2ad1207be 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -25,6 +25,8 @@ // Copypaste of parent for performance. /turf/space/Initialize() + SHOULD_CALL_PARENT(FALSE) + if(use_space_appearance) appearance = SSskybox.space_appearance_cache[(((x + y) ^ ~(x * y) + z) % 25) + 1] if(config.starlight && use_starlight && lighting_overlays_initialized) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 8e6b3e4dda6..65306588bc8 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -57,6 +57,8 @@ // Parent code is duplicated in here instead of ..() for performance reasons. // There's ALSO a copy of this in mine_turfs.dm! /turf/Initialize(mapload, ...) + SHOULD_CALL_PARENT(FALSE) + if (initialized) crash_with("Warning: [src]([type]) initialized multiple times!") diff --git a/code/game/turfs/unsimulated/floor.dm b/code/game/turfs/unsimulated/floor.dm index 7f3f7396b4e..c5b70ee3482 100644 --- a/code/game/turfs/unsimulated/floor.dm +++ b/code/game/turfs/unsimulated/floor.dm @@ -48,6 +48,8 @@ return /turf/unsimulated/mask/Initialize() + SHOULD_CALL_PARENT(FALSE) + initialized = TRUE return diff --git a/code/modules/emotes/emote_mob.dm b/code/modules/emotes/emote_mob.dm index 0503b3c6274..de292b268a9 100644 --- a/code/modules/emotes/emote_mob.dm +++ b/code/modules/emotes/emote_mob.dm @@ -9,19 +9,52 @@ set category = "IC" set desc = "Type in an emote message that will be received by mobs that can hear you." - custom_emote(m_type = AUDIBLE_MESSAGE) + custom_emote(m_type = AUDIBLE_MESSAGE, message = sanitize(input(src,"Choose an emote to display.") as text|null)) /mob/verb/custom_visible_emote() set name = "Visible Emote" set category = "IC" set desc = "Type in an emote message that will be received by mobs that can see you." - custom_emote(m_type = VISIBLE_MESSAGE) + custom_emote(m_type = VISIBLE_MESSAGE, message = sanitize(input(src,"Choose an emote to display.") as text|null)) /mob/proc/emote(var/act, var/m_type, var/message) // s-s-snowflake if((src.stat == DEAD || src.status_flags & FAKEDEATH) && act != "deathgasp") return + + var/splitpoint = findtext(act, " ") + if(splitpoint > 0) + var/tempstr = act + act = copytext(tempstr,1,splitpoint) + message = copytext(tempstr,splitpoint+1,0) + + var/singleton/emote/use_emote = usable_emotes[act] + if(!use_emote) + to_chat(src, SPAN_WARNING("Unknown emote '[act]'. Type say *help for a list of usable emotes.")) + return + + if(m_type && m_type != use_emote.message_type) + return + + if(!use_emote.can_do_emote(src)) + return + + if(use_emote.message_type == AUDIBLE_MESSAGE && is_muzzled()) + audible_message("\The [src] makes a muffled sound.") + return + else + use_emote.do_emote(src, message) + + for (var/obj/item/implant/I in src) + if (I.implanted) + I.trigger(act, src) + + +/mob/proc/client_emote(var/act, var/m_type, var/message) + if((src.stat == DEAD || src.status_flags & FAKEDEATH) && act != "deathgasp") + return + if(usr == src) //client-called emote if (client && (client.prefs.muted & MUTE_IC)) to_chat(src, "You cannot send IC messages (muted).") @@ -49,33 +82,7 @@ else m_type = AUDIBLE_MESSAGE return custom_emote(m_type, message) - - var/splitpoint = findtext(act, " ") - if(splitpoint > 0) - var/tempstr = act - act = copytext(tempstr,1,splitpoint) - message = copytext(tempstr,splitpoint+1,0) - - var/singleton/emote/use_emote = usable_emotes[act] - if(!use_emote) - to_chat(src, "Unknown emote '[act]'. Type say *help for a list of usable emotes.") - return - - if(m_type && m_type != use_emote.message_type) - return - - if(!use_emote.can_do_emote(src)) - return - - if(use_emote.message_type == AUDIBLE_MESSAGE && is_muzzled()) - audible_message("\The [src] makes a muffled sound.") - return - else - use_emote.do_emote(src, message) - - for (var/obj/item/implant/I in src) - if (I.implanted) - I.trigger(act, src) + return emote(act) /mob/proc/format_emote(var/emoter = null, var/message = null) var/pretext @@ -138,17 +145,11 @@ to_chat(src, "You are unable to emote.") return - var/input if(!message) - input = sanitize(input(src,"Choose an emote to display.") as text|null) - else - input = message - - if(input) - message = format_emote(src, input) - else return + message = format_emote(src, message) + if (message) log_emote("[name]/[key] : [message]") diff --git a/code/modules/heavy_vehicle/mech_wreckage.dm b/code/modules/heavy_vehicle/mech_wreckage.dm index 4c0f8e2e37f..bc069e39503 100644 --- a/code/modules/heavy_vehicle/mech_wreckage.dm +++ b/code/modules/heavy_vehicle/mech_wreckage.dm @@ -13,15 +13,19 @@ if(exosuit) name = "wreckage of \the [exosuit.name]" if(!gibbed) - for(var/hardpoint in exosuit.hardpoints) - if(exosuit.hardpoints[hardpoint] && prob(40)) - var/obj/item/thing = exosuit.hardpoints[hardpoint] - if(exosuit.remove_system(hardpoint)) - thing.forceMove(src) + INVOKE_ASYNC(src, PROC_REF(wreck_break_hardpoint), exosuit) for(var/obj/item/mech_component/comp in list(exosuit.arms, exosuit.legs, exosuit.head, exosuit.body)) if(comp && prob(40)) exosuit.remove_body_part(comp, src) +/obj/structure/mech_wreckage/proc/wreck_break_hardpoint(var/mob/living/heavy_vehicle/exosuit) + for(var/hardpoint in exosuit.hardpoints) + if(exosuit.hardpoints[hardpoint] && prob(40)) + var/obj/item/thing = exosuit.hardpoints[hardpoint] + if(exosuit.remove_system(hardpoint)) + thing.forceMove(src) + + /obj/structure/mech_wreckage/powerloader/Initialize(mapload) var/mob/living/heavy_vehicle/premade/ripley/new_mech = new(loc) . = ..(mapload, new_mech, FALSE) diff --git a/code/modules/heavy_vehicle/mecha.dm b/code/modules/heavy_vehicle/mecha.dm index 49eb9033be9..e208854030b 100644 --- a/code/modules/heavy_vehicle/mecha.dm +++ b/code/modules/heavy_vehicle/mecha.dm @@ -230,7 +230,7 @@ update_icon() add_language(LANGUAGE_TCB) - set_default_language(all_languages[LANGUAGE_TCB]) + default_language = all_languages[LANGUAGE_TCB] . = INITIALIZE_HINT_LATELOAD diff --git a/code/modules/heavy_vehicle/premade/_premade.dm b/code/modules/heavy_vehicle/premade/_premade.dm index 006896cac0f..73078e35946 100644 --- a/code/modules/heavy_vehicle/premade/_premade.dm +++ b/code/modules/heavy_vehicle/premade/_premade.dm @@ -30,9 +30,9 @@ material = SSmaterials.get_material_by_name(MATERIAL_STEEL) update_icon() . = ..() - spawn_mech_equipment() + INVOKE_ASYNC(src, PROC_REF(spawn_mech_equipment)) if(remote_network) - become_remote() + INVOKE_ASYNC(src, PROC_REF(become_remote)) /mob/living/heavy_vehicle/premade/proc/add_parts() if(!head && e_head) diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index f1bbd01f00c..12e44b35d61 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -177,6 +177,8 @@ var/list/mineral_can_smooth_with = list( smoothing_hints = SMOOTHHINT_CUT_F | SMOOTHHINT_ONLY_MATCH_TURF | SMOOTHHINT_TARGETS_NOT_UNIQUE /turf/unsimulated/mineral/asteroid/Initialize(mapload) + SHOULD_CALL_PARENT(FALSE) + if(initialized) crash_with("Warning: [src]([type]) initialized multiple times!") diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index e3d89ea2790..43faa14a295 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -30,7 +30,7 @@ . = ..() update_icon() add_language(LANGUAGE_TCB) - set_default_language(all_languages[LANGUAGE_TCB]) + default_language = all_languages[LANGUAGE_TCB] botcard = new /obj/item/card/id(src) botcard.access = botcard_access.Copy() diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 59e4cea158e..504e89cc316 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -13,7 +13,7 @@ /mob/living/carbon/brain/Initialize() . = ..() add_language(LANGUAGE_TCB) - set_default_language(all_languages[LANGUAGE_TCB]) + default_language = all_languages[LANGUAGE_TCB] /mob/living/carbon/brain/Destroy() if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting. @@ -33,4 +33,4 @@ else canmove = 0 - return canmove \ No newline at end of file + return canmove diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index b8578bec788..725954e561b 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -642,6 +642,7 @@ for(var/obj/machinery/light/L in range(7)) L.broken() + CHECK_TICK /mob/living/carbon/human/proc/create_darkness() set category = "Abilities" diff --git a/code/modules/mob/living/carbon/human/species/outsider/undead.dm b/code/modules/mob/living/carbon/human/species/outsider/undead.dm index 33292ab1d6f..8b3b9fed753 100644 --- a/code/modules/mob/living/carbon/human/species/outsider/undead.dm +++ b/code/modules/mob/living/carbon/human/species/outsider/undead.dm @@ -135,8 +135,6 @@ hud_type = /datum/hud_data/construct /datum/species/apparition/handle_death(var/mob/living/carbon/human/H) - set waitfor = 0 - sleep(1) new /obj/effect/decal/cleanable/ash(H.loc) qdel(H) diff --git a/code/modules/mob/living/carbon/human/species/station/golem.dm b/code/modules/mob/living/carbon/human/species/station/golem.dm index 3e71859230f..0820fa140fa 100644 --- a/code/modules/mob/living/carbon/human/species/station/golem.dm +++ b/code/modules/mob/living/carbon/human/species/station/golem.dm @@ -116,8 +116,6 @@ var/global/list/golem_types = list(SPECIES_GOLEM_COAL, /datum/species/golem/handle_death(var/mob/living/carbon/human/H) if(turn_into_materials) - set waitfor = 0 - sleep(1) new H.species.meat_type(H.loc, rand(3,8)) qdel(H) @@ -411,8 +409,6 @@ var/global/list/golem_types = list(SPECIES_GOLEM_COAL, return -1 // complete projectile permutation /datum/species/golem/glass/handle_death(var/mob/living/carbon/human/H) - set waitfor = 0 - sleep(1) for(var/i in 1 to 5) var/obj/item/material/shard/T = new meat_type(H.loc) var/turf/landing = get_step(H, pick(alldirs)) @@ -451,8 +447,6 @@ var/global/list/golem_types = list(SPECIES_GOLEM_COAL, golem_designation = "Phoron" /datum/species/golem/phoron/handle_death(var/mob/living/carbon/human/H) - set waitfor = 0 - sleep(1) var/turf/location = get_turf(H) for(var/turf/simulated/floor/target_tile in range(0,location)) target_tile.assume_gas(GAS_PHORON, 200, 100+T0C) @@ -829,8 +823,6 @@ var/global/list/golem_types = list(SPECIES_GOLEM_COAL, /datum/species/golem/homunculus/handle_death(var/mob/living/carbon/human/H) if(turn_into_materials) - set waitfor = 0 - sleep(1) H.gib() /datum/species/golem/homunculus/handle_environment_special(var/mob/living/carbon/human/H) diff --git a/code/modules/mob/living/carbon/slime/items.dm b/code/modules/mob/living/carbon/slime/items.dm index 95a298a5c5a..fd46d39f64b 100644 --- a/code/modules/mob/living/carbon/slime/items.dm +++ b/code/modules/mob/living/carbon/slime/items.dm @@ -130,6 +130,7 @@ icon_state = "bottle-1" /obj/item/docility_serum/Initialize() // Better than hardsprited in stuff. + . = ..() var/mutable_appearance/filling = mutable_appearance(icon, "[icon_state]-100") filling.color = COLOR_PINK add_overlay(filling) @@ -173,6 +174,7 @@ icon_state = "bottle-1" /obj/item/advanced_docility_serum/Initialize() // Better than hardsprited in stuff. + . = ..() var/mutable_appearance/filling = mutable_appearance(icon, "[icon_state]-100") filling.color = COLOR_PALE_PINK add_overlay(filling) @@ -216,6 +218,8 @@ icon_state = "bottle-1" /obj/item/slimesteroid/Initialize() // Better than hardsprited in stuff. + SHOULD_CALL_PARENT(FALSE) + var/mutable_appearance/filling = mutable_appearance(icon, "[icon_state]-100") filling.color = COLOR_GREEN add_overlay(filling) @@ -248,6 +252,8 @@ icon_state = "bottle-1" /obj/item/extract_enhancer/Initialize() // Better than hardsprited in stuff. + SHOULD_CALL_PARENT(FALSE) + var/mutable_appearance/filling = mutable_appearance(icon, "[icon_state]-100") filling.color = COLOR_BLUE add_overlay(filling) diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm index a6f0827c1ee..fb7337be151 100644 --- a/code/modules/mob/living/carbon/slime/slime.dm +++ b/code/modules/mob/living/carbon/slime/slime.dm @@ -75,7 +75,7 @@ add_verb(src, /mob/living/proc/ventcrawl) add_language(LANGUAGE_TCB) - set_default_language(all_languages[LANGUAGE_TCB]) + src.default_language = all_languages[LANGUAGE_TCB] src.colour = colour number = rand(1, 1000) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 13ac59e4bbe..a10eb534512 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -196,7 +196,7 @@ var/list/channel_to_radio_key = new var/regex/emote = regex("^(\[\\*^\])\[^*\]+$") if(emote.Find(message)) - if(emote.group[1] == "*") return emote(copytext(message, 2)) + if(emote.group[1] == "*") return client_emote(copytext(message, 2)) if(emote.group[1] == "^") return custom_emote(VISIBLE_MESSAGE, copytext(message,2)) //parse the radio code and consume it diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 3755897d5d9..2b9d7dbe61b 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -171,7 +171,7 @@ if(!card.radio) card.radio = new /obj/item/device/radio/pai(src.card) radio = card.radio - card.recalculateChannels() + INVOKE_ASYNC(card, TYPE_PROC_REF(/obj/item/device/paicard, recalculateChannels)) //Default languages without universal translator software diff --git a/code/modules/mob/living/silicon/robot/combat_robot.dm b/code/modules/mob/living/silicon/robot/combat_robot.dm index 89aa9bf1b17..e15d532f408 100644 --- a/code/modules/mob/living/silicon/robot/combat_robot.dm +++ b/code/modules/mob/living/silicon/robot/combat_robot.dm @@ -45,7 +45,7 @@ assigned_antagonist.add_antagonist_mind(src.mind, TRUE) if(assigned_antagonist.get_antag_radio()) module.channels[assigned_antagonist.get_antag_radio()] = TRUE - radio.recalculateChannels() + INVOKE_ASYNC(radio, TYPE_PROC_REF(/obj/item/device/radio/borg, recalculateChannels)) client.init_verbs() say("Boot sequence complete!") return src diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 88686f7704d..d37698ef3b8 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -91,7 +91,7 @@ /mob/living/silicon/robot/drone/Initialize() . = ..() - set_default_language(all_languages[LANGUAGE_LOCAL_DRONE]) + default_language = all_languages[LANGUAGE_LOCAL_DRONE] /mob/living/silicon/robot/drone/Destroy() if(master_matrix) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index e581f1946f3..7764c5640ec 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -242,7 +242,7 @@ new spawn_module(src, src) if(key_type) radio.keyslot = new key_type(radio) - radio.recalculateChannels() + INVOKE_ASYNC(radio, TYPE_PROC_REF(/obj/item/device/radio/borg, recalculateChannels)) if(law_update) var/new_ai = select_active_ai_with_fewest_borgs() if(new_ai) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 7b414e3bb09..09c5cafc191 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -67,7 +67,7 @@ var/global/list/robot_modules = list( apply_status_flags(R) if(R.radio) - R.radio.recalculateChannels() + INVOKE_ASYNC(R.radio, TYPE_PROC_REF(/obj/item/device/radio/borg, recalculateChannels)) R.set_module_sprites(sprites) R.icon_selected = FALSE @@ -914,7 +914,7 @@ var/global/list/robot_modules = list( supported_upgrades = list(/obj/item/robot_parts/robot_component/jetpack) if(R.radio) - R.radio.recalculateChannels() + INVOKE_ASYNC(R.radio, TYPE_PROC_REF(/obj/item/device/radio/borg, recalculateChannels)) /obj/item/robot_module/military name = "military robot module" diff --git a/code/modules/mob/living/simple_animal/corpse.dm b/code/modules/mob/living/simple_animal/corpse.dm index 0343392c04f..ca9f0771800 100644 --- a/code/modules/mob/living/simple_animal/corpse.dm +++ b/code/modules/mob/living/simple_animal/corpse.dm @@ -28,6 +28,7 @@ var/corpseidicon = null //For setting it to be a gold, silver, centcomm etc ID /obj/effect/landmark/mobcorpse/Initialize() + . = ..() createCorpse() initialized = TRUE diff --git a/code/modules/mob/living/simple_animal/friendly/ratking.dm b/code/modules/mob/living/simple_animal/friendly/ratking.dm index c7fae7b5396..5d1ac58430e 100644 --- a/code/modules/mob/living/simple_animal/friendly/ratking.dm +++ b/code/modules/mob/living/simple_animal/friendly/ratking.dm @@ -201,6 +201,8 @@ L.broken() else L.flicker() + CHECK_TICK + last_special = world.time + 30 /mob/living/simple_animal/rat/king/verb/devourdead(mob/target as mob in oview()) diff --git a/code/modules/mob/living/simple_animal/friendly/slime.dm b/code/modules/mob/living/simple_animal/friendly/slime.dm index de2c33774f0..2dbbada1e1c 100644 --- a/code/modules/mob/living/simple_animal/friendly/slime.dm +++ b/code/modules/mob/living/simple_animal/friendly/slime.dm @@ -20,7 +20,7 @@ /mob/living/simple_animal/slime/Initialize() . = ..() add_language(LANGUAGE_TCB) - set_default_language(all_languages[LANGUAGE_TCB]) + default_language = all_languages[LANGUAGE_TCB] /mob/living/simple_animal/slime/can_force_feed(var/feeder, var/food, var/feedback) if(feedback) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index b2cb2d73d89..f1f209fec94 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -182,7 +182,7 @@ if(simple_default_language) add_language(simple_default_language) - set_default_language(all_languages[simple_default_language]) + default_language = all_languages[simple_default_language] if(dead_on_map) death() diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 28758144feb..c362362da64 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -32,7 +32,7 @@ return if(use_me) - usr.emote("me",usr.emote_type,message) + usr.client_emote("me",usr.emote_type,message) else usr.emote(message) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index efad734b5ab..1cbbb72ef09 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1595,7 +1595,7 @@ if (prob(chance)) L.stat &= ~POWEROFF L.broken() - stoplag(1) + CHECK_TICK /obj/machinery/power/apc/proc/flicker_all() var/offset = 0 diff --git a/code/modules/power/lights/fixtures.dm b/code/modules/power/lights/fixtures.dm index c08917bf274..1d04a958569 100644 --- a/code/modules/power/lights/fixtures.dm +++ b/code/modules/power/lights/fixtures.dm @@ -633,8 +633,6 @@ status = LIGHT_BROKEN stat |= BROKEN update() - if (!skip_sound_and_sparks) - CHECK_TICK // For lights-out events. /obj/machinery/light/proc/shatter() if(status == LIGHT_EMPTY) diff --git a/code/modules/psionics/abilities/lightning.dm b/code/modules/psionics/abilities/lightning.dm index d590d22887b..37e3b0028f7 100644 --- a/code/modules/psionics/abilities/lightning.dm +++ b/code/modules/psionics/abilities/lightning.dm @@ -52,8 +52,9 @@ armor_penetration = 20 /obj/item/projectile/beam/psi_lightning/wide/Initialize() + . = ..() for(var/i = 1 to 4) var/turf/new_turf = get_random_turf_in_range(get_turf(firer), i + rand(0, i), 0, TRUE, FALSE) var/obj/item/projectile/beam/psi_lightning/pellet/pellet = new type(new_turf) var/turf/front_turf = get_step(pellet, pellet.dir) - pellet.launch_projectile(front_turf) + INVOKE_ASYNC(pellet, TYPE_PROC_REF(/obj/item/projectile/beam/psi_lightning/pellet, launch_projectile), front_turf) diff --git a/code/modules/telesci/gps.dm b/code/modules/telesci/gps.dm index 5e14dcbda40..a8c65dc3d63 100644 --- a/code/modules/telesci/gps.dm +++ b/code/modules/telesci/gps.dm @@ -318,6 +318,8 @@ var/list/GPS_list = list() gpstag = "STAT0" /obj/item/device/gps/stationary/Initialize() + SHOULD_CALL_PARENT(FALSE) + compass = new(src) update_position() diff --git a/html/changelogs/fluffyghost-spacemandmmgalore.yml b/html/changelogs/fluffyghost-spacemandmmgalore.yml new file mode 100644 index 00000000000..201aa54c563 --- /dev/null +++ b/html/changelogs/fluffyghost-spacemandmmgalore.yml @@ -0,0 +1,43 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - backend: "Added some dmdoc comments." + - backend: "Added spacemandmm flags to the Initialize proc." + - refactor: "Refactored various procs to not have blocking sleeps during init."