diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 1b038bf73b9..41573ed7af7 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -224,7 +224,7 @@ else if(window) entry += " in [window.id]" // Resolve src_object - if(!src_object && window && window.locked_by) + if(!src_object && window?.locked_by) src_object = window.locked_by.src_object // Insert src_object info if(src_object) @@ -299,7 +299,7 @@ include_link = FALSE if(key) - if(C && C.holder && C.holder.fakekey && !include_name) + if(C?.holder && C.holder.fakekey && !include_name) if(include_link) . += "" . += "Administrator" diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index e4c6b403e05..fb30d979702 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -312,7 +312,7 @@ return null /proc/considered_alive(datum/mind/M, enforce_human = TRUE) - if(M && M.current) + if(M?.current) if(enforce_human) var/mob/living/carbon/human/H if(ishuman(M.current)) @@ -369,7 +369,7 @@ var/active_players = 0 for(var/i = 1; i <= GLOB.player_list.len; i++) var/mob/M = GLOB.player_list[i] - if(M && M.client) + if(M?.client) if(alive_check && M.stat) continue else if(afk_check && M.client.is_afk()) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index fe54b21bf66..259d89bef9f 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -12,7 +12,7 @@ var/num_escapees = 0 //Above and on centcom z var/num_shuttle_escapees = 0 //Above and on escape shuttle var/list/area/shuttle_areas - if(SSshuttle && SSshuttle.emergency) + if(SSshuttle?.emergency) shuttle_areas = SSshuttle.emergency.shuttle_areas for(var/mob/M in GLOB.mob_list) diff --git a/code/__HELPERS/sanitize_values.dm b/code/__HELPERS/sanitize_values.dm index 2d4af7f8cd1..00f6ddc5cd8 100644 --- a/code/__HELPERS/sanitize_values.dm +++ b/code/__HELPERS/sanitize_values.dm @@ -22,7 +22,7 @@ return value if(default) return default - if(List && List.len) + if(List?.len) return pick(List) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 0195d942140..6ca5b8cdfa2 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -197,7 +197,7 @@ Turf and target are separate in case you want to teleport some distance from a t var/banned = C ? is_banned_from(C.ckey, "Appearance") : null while(loop && safety < 5) - if(C && C.prefs.custom_names[role] && !safety && !banned) + if(C?.prefs.custom_names[role] && !safety && !banned) newname = C.prefs.custom_names[role] else switch(role) @@ -332,7 +332,7 @@ Turf and target are separate in case you want to teleport some distance from a t //Optional arg 'type' to stop once it reaches a specific type instead of a turf. /proc/get_atom_on_turf(atom/movable/M, stop_type) var/atom/loc = M - while(loc && loc.loc && !isturf(loc.loc)) + while(loc?.loc && !isturf(loc.loc)) loc = loc.loc if(stop_type && istype(loc, stop_type)) break diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 60126719d5f..a224ee9b765 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -465,7 +465,7 @@ /mob/proc/check_click_intercept(params,A) //Client level intercept - if(client && client.click_intercept) + if(client?.click_intercept) if(call(client.click_intercept, "InterceptClickOn")(src, params, A)) return TRUE diff --git a/code/_onclick/drag_drop.dm b/code/_onclick/drag_drop.dm index d40d0e65504..536e09b3b8e 100644 --- a/code/_onclick/drag_drop.dm +++ b/code/_onclick/drag_drop.dm @@ -98,7 +98,7 @@ mouseParams = params mouseLocation = over_location mouseObject = over_object - if(selected_target[1] && over_object && over_object.IsAutoclickable()) + if(selected_target[1] && over_object?.IsAutoclickable()) selected_target[1] = over_object selected_target[2] = params if(active_mousedown_item) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index e3170d99456..47a01367b98 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -401,7 +401,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." antag.cult_team.blood_target = null else blood_target = antag.cult_team.blood_target - if(Cviewer && Cviewer.seeking && Cviewer.master) + if(Cviewer?.seeking && Cviewer.master) blood_target = Cviewer.master desc = "Your blood sense is leading you to [Cviewer.master]" if(!blood_target) diff --git a/code/_onclick/hud/blob_overmind.dm b/code/_onclick/hud/blob_overmind.dm index be1c020db16..71e1c00dc32 100644 --- a/code/_onclick/hud/blob_overmind.dm +++ b/code/_onclick/hud/blob_overmind.dm @@ -34,7 +34,7 @@ desc = "Moves your camera to your blob core." /obj/screen/blob/jump_to_core/MouseEntered(location,control,params) - if(hud && hud.mymob && isovermind(hud.mymob)) + if(hud?.mymob && isovermind(hud.mymob)) var/mob/camera/blob/B = hud.mymob if(!B.placed) name = "Place Blob Core" @@ -97,7 +97,7 @@ desc = "Allows you to choose a new strain from 4 random choices for 40 resources." /obj/screen/blob/readapt_strain/MouseEntered(location,control,params) - if(hud && hud.mymob && isovermind(hud.mymob)) + if(hud?.mymob && isovermind(hud.mymob)) var/mob/camera/blob/B = hud.mymob if(B.free_strain_rerolls) name = "Readapt Strain (FREE)" diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index 133f2c36706..b2e94d6e15d 100755 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -225,11 +225,11 @@ if(length(client_mobs_in_contents)) for(var/thing in client_mobs_in_contents) var/mob/M = thing - if(M && M.client && M.hud_used && length(M.client.parallax_layers)) + if(M?.client && M.hud_used && length(M.client.parallax_layers)) M.hud_used.update_parallax() /mob/proc/update_parallax_teleport() //used for arrivals shuttle - if(client && client.eye && hud_used && length(client.parallax_layers)) + if(client?.eye && hud_used && length(client.parallax_layers)) var/area/areaobj = get_area(client.eye) hud_used.set_parallax_movedir(areaobj.parallax_movedir, TRUE) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index bd6e4f906c4..d5e0e63fb13 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -2,7 +2,7 @@ if(check_click_intercept(params, A)) return - if(can_reenter_corpse && mind && mind.current) + if(can_reenter_corpse && mind?.current) if(A == mind.current || (mind.current in A)) // double click your corpse or whatever holds it reenter_corpse() // (body bag, closet, mech, etc) return // seems legit. @@ -76,6 +76,6 @@ return ..() /obj/machinery/teleport/hub/attack_ghost(mob/user) - if(power_station && power_station.engaged && power_station.teleporter_console && power_station.teleporter_console.target) + if(power_station?.engaged && power_station.teleporter_console && power_station.teleporter_console.target) user.forceMove(get_turf(power_station.teleporter_console.target)) return ..() diff --git a/code/controllers/subsystem/economy.dm b/code/controllers/subsystem/economy.dm index 142b011333d..16f242d2a83 100644 --- a/code/controllers/subsystem/economy.dm +++ b/code/controllers/subsystem/economy.dm @@ -79,7 +79,7 @@ SUBSYSTEM_DEF(economy) for(var/account in bank_accounts) var/datum/bank_account/bank_account = account bank_account.payday(1) - if(bank_account && bank_account.account_job) + if(bank_account?.account_job) temporary_total += (bank_account.account_job.paycheck * STARTING_PAYCHECKS) if(!istype(bank_account, /datum/bank_account/department)) station_total += bank_account.account_balance diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index 0e1041c5fbc..5ac15a1090f 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -77,7 +77,7 @@ SUBSYSTEM_DEF(job) /datum/controller/subsystem/job/proc/AssignRole(mob/dead/new_player/player, rank, latejoin = FALSE) JobDebug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]") - if(player && player.mind && rank) + if(player?.mind && rank) var/datum/job/job = GetJob(rank) if(!job) return FALSE diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index a22a93fdb1e..5a390dfc91b 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -364,7 +364,7 @@ SUBSYSTEM_DEF(persistence) //asert globchems done for(var/randomized_type in subtypesof(/datum/chemical_reaction/randomized)) var/datum/chemical_reaction/randomized/R = get_chemical_reaction(randomized_type) //ew, would be nice to add some simple tracking - if(R && R.persistent) + if(R?.persistent) var/recipe_data = list() recipe_data["timestamp"] = R.created recipe_data["required_reagents"] = R.required_reagents diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 35edb9abbff..e65bdf134fe 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -714,7 +714,7 @@ SUBSYSTEM_DEF(shuttle) var/list/force_memory = preview_shuttle.movement_force preview_shuttle.movement_force = list("KNOCKDOWN" = 0, "THROW" = 0) - preview_shuttle.mode = SHUTTLE_PREARRIVAL//No idle shuttle moving. Transit dock get removed if shuttle moves too long. + preview_shuttle.mode = SHUTTLE_PREARRIVAL//No idle shuttle moving. Transit dock get removed if shuttle moves too long. preview_shuttle.initiate_docking(D) preview_shuttle.movement_force = force_memory diff --git a/code/controllers/subsystem/tgui.dm b/code/controllers/subsystem/tgui.dm index 6075c9b6751..c4e823dca50 100644 --- a/code/controllers/subsystem/tgui.dm +++ b/code/controllers/subsystem/tgui.dm @@ -42,7 +42,7 @@ SUBSYSTEM_DEF(tgui) var/datum/tgui/ui = current_run[current_run.len] current_run.len-- // TODO: Move user/src_object check to process() - if(ui && ui.user && ui.src_object) + if(ui?.user && ui.src_object) ui.process(wait * 0.1) else open_uis.Remove(ui) @@ -191,7 +191,7 @@ SUBSYSTEM_DEF(tgui) return count for(var/datum/tgui/ui in open_uis_by_src[key]) // Check if UI is valid. - if(ui && ui.src_object && ui.user && ui.src_object.ui_host(ui.user)) + if(ui?.src_object && ui.user && ui.src_object.ui_host(ui.user)) ui.process(wait * 0.1, force = 1) count++ return count @@ -213,7 +213,7 @@ SUBSYSTEM_DEF(tgui) return count for(var/datum/tgui/ui in open_uis_by_src[key]) // Check if UI is valid. - if(ui && ui.src_object && ui.user && ui.src_object.ui_host(ui.user)) + if(ui?.src_object && ui.user && ui.src_object.ui_host(ui.user)) ui.close() count++ return count @@ -230,7 +230,7 @@ SUBSYSTEM_DEF(tgui) for(var/key in open_uis_by_src) for(var/datum/tgui/ui in open_uis_by_src[key]) // Check if UI is valid. - if(ui && ui.src_object && ui.user && ui.src_object.ui_host(ui.user)) + if(ui?.src_object && ui.user && ui.src_object.ui_host(ui.user)) ui.close() count++ return count diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 9022fdbcaa0..357e2bbfdf1 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -456,7 +456,7 @@ SUBSYSTEM_DEF(ticker) if(5) //every 5 ticks check if there is a slot available listclearnulls(queued_players) if(living_player_count() < hpc) - if(next_in_line && next_in_line.client) + if(next_in_line?.client) to_chat(next_in_line, "A slot has opened! You have approximately 20 seconds to join. \>\>Join Game\<\<") SEND_SOUND(next_in_line, sound('sound/misc/notice1.ogg')) next_in_line.LateChoices() diff --git a/code/datums/action.dm b/code/datums/action.dm index cf26f78a576..f1e4d33d1ed 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -113,7 +113,7 @@ if(!status_only) button.name = name button.desc = desc - if(owner && owner.hud_used && background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND) + if(owner?.hud_used && background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND) var/list/settings = owner.hud_used.get_action_buttons_icons() if(button.icon != settings["bg_icon"]) button.icon = settings["bg_icon"] diff --git a/code/datums/brain_damage/brain_trauma.dm b/code/datums/brain_damage/brain_trauma.dm index c2964549b72..b3cdd7befcf 100644 --- a/code/datums/brain_damage/brain_trauma.dm +++ b/code/datums/brain_damage/brain_trauma.dm @@ -16,7 +16,7 @@ var/resilience = TRAUMA_RESILIENCE_BASIC //how hard is this to cure? /datum/brain_trauma/Destroy() - if(brain && brain.traumas) + if(brain?.traumas) brain.traumas -= src if(owner) on_lose() diff --git a/code/datums/browser.dm b/code/datums/browser.dm index cb3d3af7070..6604c058ccc 100644 --- a/code/datums/browser.dm +++ b/code/datums/browser.dm @@ -458,5 +458,5 @@ // no atomref specified (or not found) // so just reset the user mob's machine var - if(src && src.mob) + if(src?.mob) src.mob.unset_machine() diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index ecb7f4651c3..4621c1ba3ee 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -310,7 +310,7 @@ return var/mob/living/owner = parent var/datum/hud/hud = owner.hud_used - if(hud && hud.infodisplay) + if(hud?.infodisplay) hud.infodisplay -= screen_obj QDEL_NULL(screen_obj) diff --git a/code/datums/components/remote_materials.dm b/code/datums/components/remote_materials.dm index 980a9dd0ea1..c2b9f13887d 100644 --- a/code/datums/components/remote_materials.dm +++ b/code/datums/components/remote_materials.dm @@ -119,7 +119,7 @@ handles linking back and forth. return COMPONENT_BLOCK_TOOL_ATTACK /datum/component/remote_materials/proc/on_hold() - return silo && silo.holds["[get_area(parent)]/[category]"] + return silo?.holds["[get_area(parent)]/[category]"] /datum/component/remote_materials/proc/silo_log(obj/machinery/M, action, amount, noun, list/mats) if (silo) diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index dd1c414f8b8..d911ca9cdca 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -635,7 +635,7 @@ to_chat(M, "[I] is too big for [host]!") return FALSE var/datum/component/storage/biggerfish = real_location.loc.GetComponent(/datum/component/storage) - if(biggerfish && biggerfish.max_w_class < max_w_class)//return false if we are inside of another container, and that container has a smaller max_w_class than us (like if we're a bag in a box) + if(biggerfish && biggerfish.max_w_class < max_w_class) //return false if we are inside of another container, and that container has a smaller max_w_class than us (like if we're a bag in a box) if(!stop_messages) to_chat(M, "[I] can't fit in [host] while [real_location.loc] is in the way!") return FALSE diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 4f3ed4ede74..a88564ada52 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -210,7 +210,7 @@ /datum/disease/advance/proc/Refresh(new_name = FALSE) GenerateProperties() AssignProperties() - if(processing && symptoms && symptoms.len) + if(processing && symptoms?.len) for(var/datum/symptom/S in symptoms) S.Start(src) S.on_stage_change(src) @@ -238,7 +238,7 @@ // Assign the properties that are in the list. /datum/disease/advance/proc/AssignProperties() - if(properties && properties.len) + if(properties?.len) if(properties["stealth"] >= 2) visibility_flags |= HIDDEN_SCANNER else @@ -308,7 +308,7 @@ // Will generate a random cure, the more resistance the symptoms have, the harder the cure. /datum/disease/advance/proc/GenerateCure() - if(properties && properties.len) + if(properties?.len) var/res = clamp(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len) if(res == oldres) return diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 2f1263dc4c7..3d44036dbbf 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -120,7 +120,7 @@ /datum/dna/proc/generate_dna_blocks() var/bonus - if(species && species.inert_mutation) + if(species?.inert_mutation) bonus = GET_INITIALIZED_MUTATION(species.inert_mutation) var/list/mutations_temp = GLOB.good_mutations + GLOB.bad_mutations + GLOB.not_good_mutations + bonus if(!LAZYLEN(mutations_temp)) diff --git a/code/datums/forced_movement.dm b/code/datums/forced_movement.dm index 551699a0191..2252bb6c665 100644 --- a/code/datums/forced_movement.dm +++ b/code/datums/forced_movement.dm @@ -87,7 +87,7 @@ /mob/Bump(atom/A) . = ..() - if(force_moving && force_moving.allow_climbing && isstructure(A)) + if(force_moving?.allow_climbing && isstructure(A)) var/obj/structure/S = A if(S.climbable) S.do_climb(src) diff --git a/code/datums/hud.dm b/code/datums/hud.dm index 96def45114b..4b7fe138992 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -131,7 +131,7 @@ GLOBAL_LIST_INIT(huds, list( //MOB PROCS /mob/proc/reload_huds() for(var/datum/atom_hud/hud in GLOB.all_huds) - if(hud && hud.hudusers[src]) + if(hud?.hudusers[src]) for(var/atom/A in hud.hudatoms) hud.add_to_single_hud(src, A) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 726b237d1c3..d11fe7fdaf8 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -733,7 +733,7 @@ martial_art.teach(new_character) /datum/mind/proc/transfer_actions(mob/living/new_character) - if(current && current.actions) + if(current?.actions) for(var/datum/action/A in current.actions) A.Grant(new_character) transfer_mindbound_actions(new_character) diff --git a/code/datums/saymode.dm b/code/datums/saymode.dm index a5324ebb245..3e7c6dc9018 100644 --- a/code/datums/saymode.dm +++ b/code/datums/saymode.dm @@ -80,7 +80,7 @@ if(iscarbon(user)) var/mob/living/carbon/C = user var/obj/item/organ/vocal_cords/V = C.getorganslot(ORGAN_SLOT_VOICE) - if(V && V.can_speak_with()) + if(V?.can_speak_with()) V.handle_speech(message) //message V.speak_with(message) //action return FALSE diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 249a9c710d9..9db0d3ea8fb 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -181,7 +181,7 @@ owner.adjustFireLoss(healing) owner.adjustToxLoss(healing * 0.5, TRUE, TRUE) owner.adjustStaminaLoss(healing) - if(human_owner && human_owner.drunkenness) + if(human_owner?.drunkenness) human_owner.drunkenness *= 0.997 //reduce drunkenness by 0.3% per tick, 6% per 2 seconds if(prob(20)) if(carbon_owner) diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 688f276d96a..e4af943f2e7 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -183,7 +183,7 @@ .["extreme_popcap"] = CONFIG_GET(number/extreme_popcap) || 0 .["popcap"] = max(CONFIG_GET(number/soft_popcap), CONFIG_GET(number/hard_popcap), CONFIG_GET(number/extreme_popcap)) //generalized field for this concept for use across ss13 codebases .["bunkered"] = CONFIG_GET(flag/panic_bunker) || FALSE - if(SSshuttle && SSshuttle.emergency) + if(SSshuttle?.emergency) .["shuttle_mode"] = SSshuttle.emergency.mode // Shuttle status, see /__DEFINES/stat.dm .["shuttle_timer"] = SSshuttle.emergency.timeLeft() diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index d6376328014..7f9d37231c2 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -18,7 +18,7 @@ if(M.mind) if(ishuman(M) && (M.mind.holy_role)) return FALSE - if(specific_cult && specific_cult.is_sacrifice_target(M.mind)) + if(specific_cult?.is_sacrifice_target(M.mind)) return FALSE if(M.mind.enslaved_to && !iscultist(M.mind.enslaved_to)) return FALSE diff --git a/code/game/gamemodes/gang/gang_things.dm b/code/game/gamemodes/gang/gang_things.dm index a618404b800..9a3bbfa70b6 100644 --- a/code/game/gamemodes/gang/gang_things.dm +++ b/code/game/gamemodes/gang/gang_things.dm @@ -22,7 +22,7 @@ qdel(src) return var/datum/antagonist/gang/is_gangster = user.mind.has_antag_datum(/datum/antagonist/gang) - if(is_gangster && is_gangster.starter_gangster) + if(is_gangster?.starter_gangster) if(is_gangster.my_gang == team_to_use) to_chat(user, "You started your family. You don't need to join it.") return @@ -47,7 +47,7 @@ /// Checks if the user is trying to use the package of the family they are in, and if not, adds them to the family, with some differing processing depending on whether the user is already a family member. /obj/item/gang_induction_package/proc/attempt_join_gang(mob/living/user) - if(user && user.mind) + if(user?.mind) var/datum/antagonist/gang/is_gangster = user.mind.has_antag_datum(/datum/antagonist/gang) if(is_gangster) if(is_gangster.my_gang == team_to_use) diff --git a/code/game/gamemodes/monkey/monkey.dm b/code/game/gamemodes/monkey/monkey.dm index 83d90192aaf..54b287cb8db 100644 --- a/code/game/gamemodes/monkey/monkey.dm +++ b/code/game/gamemodes/monkey/monkey.dm @@ -125,7 +125,7 @@ return TRUE /proc/is_monkey_leader(datum/mind/monkey_mind) - return monkey_mind && monkey_mind.has_antag_datum(/datum/antagonist/monkey/leader) + return monkey_mind?.has_antag_datum(/datum/antagonist/monkey/leader) /proc/is_monkey(datum/mind/monkey_mind) return monkey_mind && (monkey_mind.has_antag_datum(/datum/antagonist/monkey) || is_monkey_leader(monkey_mind)) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 54219cdb222..d84fee2c3a6 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -16,7 +16,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list explanation_text = text /datum/objective/proc/get_owners() // Combine owner and team into a single list. - . = (team && team.members) ? team.members.Copy() : list() + . = (team?.members) ? team.members.Copy() : list() if(owner) . += owner @@ -34,7 +34,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list possible_targets = list("Free objective", "Random") + sortNames(possible_targets) - if(target && target.current) + if(target?.current) def_value = target.current var/mob/new_target = input(admin,"Select target:", "Objective target", def_value) as null|anything in possible_targets @@ -161,7 +161,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list /datum/objective/proc/give_special_equipment(special_equipment) var/datum/mind/receiver = pick(get_owners()) - if(receiver && receiver.current) + if(receiver?.current) if(ishuman(receiver.current)) var/mob/living/carbon/human/H = receiver.current var/list/slots = list("backpack" = ITEM_SLOT_BACKPACK) @@ -184,7 +184,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list /datum/objective/assassinate/update_explanation_text() ..() - if(target && target.current) + if(target?.current) explanation_text = "Assassinate [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." else explanation_text = "Free Objective" @@ -218,7 +218,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list /datum/objective/mutiny/update_explanation_text() ..() - if(target && target.current) + if(target?.current) explanation_text = "Assassinate or exile [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." else explanation_text = "Free Objective" @@ -237,7 +237,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list return !target || !considered_alive(target) || (!target.current.onCentCom() && !target.current.onSyndieBase()) /datum/objective/maroon/update_explanation_text() - if(target && target.current) + if(target?.current) explanation_text = "Prevent [target.name], the [!target_role_type ? target.assigned_role : target.special_role], from escaping alive." else explanation_text = "Free Objective" @@ -271,7 +271,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list /datum/objective/debrain/update_explanation_text() ..() - if(target && target.current) + if(target?.current) explanation_text = "Steal the brain of [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." else explanation_text = "Free Objective" @@ -300,7 +300,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list /datum/objective/protect/update_explanation_text() ..() - if(target && target.current) + if(target?.current) explanation_text = "Protect [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." else explanation_text = "Free Objective" @@ -343,7 +343,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list /datum/objective/jailbreak/detain/update_explanation_text() ..() - if(target && target.current) + if(target?.current) explanation_text = "Ensure that [target.name], the [!target_role_type ? target.assigned_role : target.special_role] is delivered to nanotrasen alive and in custody." else explanation_text = "Free Objective" @@ -445,7 +445,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list update_explanation_text() /datum/objective/escape/escape_with_identity/update_explanation_text() - if(target && target.current) + if(target?.current) target_real_name = target.current.real_name explanation_text = "Escape on the shuttle or an escape pod with the identity of [target_real_name], the [target.assigned_role]" var/mob/living/carbon/human/H @@ -818,13 +818,13 @@ GLOBAL_LIST_EMPTY(possible_items_special) return target /datum/objective/destroy/check_completion() - if(target && target.current) + if(target?.current) return target.current.stat == DEAD || target.current.z > 6 || !target.current.ckey //Borgs/brains/AIs count as dead for traitor objectives. return TRUE /datum/objective/destroy/update_explanation_text() ..() - if(target && target.current) + if(target?.current) explanation_text = "Destroy [target.name], the experimental AI." else explanation_text = "Free Objective" @@ -1053,7 +1053,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) if(ishuman(changeling.current)) var/mob/living/carbon/human/H = changeling.current var/turf/cloc = get_turf(changeling.current) - if(cloc && cloc.onCentCom() && (changeling.current.stat != DEAD)) //Living changeling on centcom.... + if(cloc?.onCentCom() && (changeling.current.stat != DEAD)) //Living changeling on centcom.... for(var/name in check_names) //Is he (disguised as) one of the staff? if(H.dna.real_name == name) check_names -= name //This staff member is accounted for, remove them, so the team don't succeed by escape as 7 of the same engineer diff --git a/code/game/machinery/civilian_bounties.dm b/code/game/machinery/civilian_bounties.dm index ab69faab142..29c02b43da3 100644 --- a/code/game/machinery/civilian_bounties.dm +++ b/code/game/machinery/civilian_bounties.dm @@ -127,7 +127,7 @@ data["sending"] = sending data["status_report"] = status_report data["id_inserted"] = inserted_scan_id - if(inserted_scan_id && inserted_scan_id.registered_account) + if(inserted_scan_id?.registered_account) data["id_bounty_info"] = inserted_scan_id.registered_account.bounty_text() data["id_bounty_num"] = inserted_scan_id.registered_account.bounty_num() data["id_bounty_value"] = inserted_scan_id.registered_account.bounty_value() diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 5647c351463..c833c1bf04f 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -255,9 +255,9 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/scan_name = inserted_scan_id ? html_encode(inserted_scan_id.name) : "--------" var/target_name = inserted_modify_id ? html_encode(inserted_modify_id.name) : "--------" - var/target_owner = (inserted_modify_id && inserted_modify_id.registered_name) ? html_encode(inserted_modify_id.registered_name) : "--------" - var/target_rank = (inserted_modify_id && inserted_modify_id.assignment) ? html_encode(inserted_modify_id.assignment) : "Unassigned" - var/target_age = (inserted_modify_id && inserted_modify_id.registered_age) ? html_encode(inserted_modify_id.registered_age) : "--------" + var/target_owner = (inserted_modify_id?.registered_name) ? html_encode(inserted_modify_id.registered_name) : "--------" + var/target_rank = (inserted_modify_id?.assignment) ? html_encode(inserted_modify_id.assignment) : "Unassigned" + var/target_age = (inserted_modify_id?.registered_age) ? html_encode(inserted_modify_id.registered_age) : "--------" if(!authenticated) header += {"
Please insert the cards into the slots
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index a0165290fd7..95c7802b0d2 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -27,7 +27,7 @@ flags_1 &= ~PREVENT_CLICK_UNDER_1 if(set_dir) setDir(set_dir) - if(req_access && req_access.len) + if(req_access?.len) icon_state = "[icon_state]" base_state = icon_state for(var/i in 1 to shards) diff --git a/code/game/machinery/embedded_controller/access_controller.dm b/code/game/machinery/embedded_controller/access_controller.dm index 922f10e70fc..4e6cb1cc653 100644 --- a/code/game/machinery/embedded_controller/access_controller.dm +++ b/code/game/machinery/embedded_controller/access_controller.dm @@ -210,7 +210,7 @@ INVOKE_ASYNC(src, .proc/do_openDoor, A) /obj/machinery/door_buttons/airlock_controller/proc/do_openDoor(obj/machinery/door/airlock/A) - if(A && A.open()) + if(A?.open()) if(machine_stat | (NOPOWER) && !lostPower && A && !QDELETED(A)) A.bolt() goIdle(TRUE) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index f7eccf62cbc..1a344b04175 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -113,13 +113,13 @@ Possible to do for anyone motivated enough: return if(replay_mode) replay_stop() - else if(disk && disk.record) + else if(disk?.record) replay_start() /obj/machinery/holopad/tutorial/HasProximity(atom/movable/AM) if (!isliving(AM)) return - if(!replay_mode && (disk && disk.record)) + if(!replay_mode && (disk?.record)) replay_start() /obj/machinery/holopad/Initialize() @@ -660,7 +660,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ record_user = null /obj/machinery/holopad/proc/record_clear() - if(disk && disk.record) + if(disk?.record) QDEL_NULL(disk.record) /obj/effect/overlay/holo_pad_hologram diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index d2f5378d4f2..3bbb3964087 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -92,10 +92,10 @@ if(auth) dat += "

\[Authenticated\] /" - dat += " Server Power: [linkedServer && linkedServer.on ? "\[On\]":"\[Off\]"]

" + dat += " Server Power: [linkedServer?.on ? "\[On\]":"\[Off\]"]" else dat += "

\[Unauthenticated\] /" - dat += " Server Power: [linkedServer && linkedServer.on ? "\[On\]":"\[Off\]"]

" + dat += " Server Power: [linkedServer?.on ? "\[On\]":"\[Off\]"]" if(hacking || (obj_flags & EMAGGED)) screen = MSG_MON_SCREEN_HACKED diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 563b8b23e6e..a7a33bfe0f7 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -55,7 +55,7 @@ /obj/machinery/teleport/hub/attackby(obj/item/W, mob/user, params) if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W)) - if(power_station && power_station.engaged) + if(power_station?.engaged) power_station.engaged = 0 //hub with panel open is off, so the station must be informed. update_icon() return @@ -216,7 +216,7 @@ icon_state = "controller-o" else if(machine_stat & (BROKEN|NOPOWER)) icon_state = "controller-p" - else if(teleporter_console && teleporter_console.calibrating) + else if(teleporter_console?.calibrating) icon_state = "controller-c" else icon_state = "controller" diff --git a/code/game/objects/effects/spawners/bundle.dm b/code/game/objects/effects/spawners/bundle.dm index fd74583b250..43ba380a8ee 100644 --- a/code/game/objects/effects/spawners/bundle.dm +++ b/code/game/objects/effects/spawners/bundle.dm @@ -8,7 +8,7 @@ /obj/effect/spawner/bundle/Initialize(mapload) ..() - if(items && items.len) + if(items?.len) for(var/path in items) new path(loc) return INITIALIZE_HINT_QDEL diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index 51b5b220e0a..eb85a666319 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -9,7 +9,7 @@ /obj/effect/spawner/lootdrop/Initialize(mapload) ..() - if(loot && loot.len) + if(loot?.len) var/loot_spawned = 0 while((lootcount-loot_spawned) && loot.len) var/lootspawn = pickweight(loot) diff --git a/code/game/objects/effects/spawners/structure.dm b/code/game/objects/effects/spawners/structure.dm index c89f61f8a90..0ab11618baa 100644 --- a/code/game/objects/effects/spawners/structure.dm +++ b/code/game/objects/effects/spawners/structure.dm @@ -10,7 +10,7 @@ again. /obj/effect/spawner/structure/Initialize() . = ..() - if(spawn_list && spawn_list.len) + if(spawn_list?.len) for(var/I in spawn_list) new I(get_turf(src)) return INITIALIZE_HINT_QDEL diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 4c47922809e..b14c5779378 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -362,7 +362,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb else to_chat(user, "You burn your hand on [src]!") var/obj/item/bodypart/affecting = C.get_bodypart("[(user.active_hand_index % 2 == 0) ? "r" : "l" ]_arm") - if(affecting && affecting.receive_damage( 0, 5 )) // 5 burn damage + if(affecting?.receive_damage( 0, 5 )) // 5 burn damage C.update_damage_overlays() return diff --git a/code/game/objects/items/RSF.dm b/code/game/objects/items/RSF.dm index 96766ba6988..9cd8a7d933a 100644 --- a/code/game/objects/items/RSF.dm +++ b/code/game/objects/items/RSF.dm @@ -182,7 +182,7 @@ RSF var/mob/living/silicon/robot/P = null if(iscyborg(user)) P = user - if(((obj_flags & EMAGGED) || (P && P.emagged)) && !toxin) + if(((obj_flags & EMAGGED) || (P?.emagged)) && !toxin) toxin = TRUE to_dispense = /obj/item/reagent_containers/food/snacks/cookie/sleepy to_chat(user, "Cookie Synthesizer hacked.") diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index d82090c86a1..a6bb5ade5f2 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -122,7 +122,7 @@ . += TT.blueprint_data /obj/item/areaeditor/blueprints/proc/set_viewer(mob/user, message = "") - if(user && user.client) + if(user?.client) if(viewing) clear_viewer() viewing = user.client diff --git a/code/game/objects/items/chrono_eraser.dm b/code/game/objects/items/chrono_eraser.dm index fc58d986335..5b4bc52183b 100644 --- a/code/game/objects/items/chrono_eraser.dm +++ b/code/game/objects/items/chrono_eraser.dm @@ -196,7 +196,7 @@ return ..() /obj/structure/chrono_field/Destroy() - if(gun && gun.field_check(src)) + if(gun?.field_check(src)) gun.field_disconnect(src) return ..() diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index f3e218171d2..f2a4e83223c 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -277,7 +277,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM qdel(src) return open_flame() - if((reagents && reagents.total_volume) && (nextdragtime <= world.time)) + if((reagents?.total_volume) && (nextdragtime <= world.time)) nextdragtime = world.time + dragtime SECONDS handle_reagents() @@ -548,7 +548,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM STOP_PROCESSING(SSobj, src) return open_flame() - if(reagents && reagents.total_volume) // check if it has any reagents at all + if(reagents?.total_volume) // check if it has any reagents at all handle_reagents() @@ -1004,5 +1004,5 @@ CIGARETTE PACKETS ARE IN FANCY.DM qdel(src) return - if(reagents && reagents.total_volume) + if(reagents?.total_volume) hand_reagents() diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 6ca39975765..4aa9112fab5 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -356,7 +356,7 @@ GLOBAL_LIST_EMPTY(PDAs) dat += "" if (count == 0) dat += "None detected.
" - else if(cartridge && cartridge.spam_enabled) + else if(cartridge?.spam_enabled) dat += "Send To All" if(6) dat += "

[PDAIMG(mail)] ExperTrak® Skill Tracker V4.26.2

" diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index b6d152d7983..14f411a7eec 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -142,7 +142,7 @@ return html /obj/item/camera_bug/proc/get_seens() - if(current && current.can_use()) + if(current?.can_use()) var/list/seen = current.can_see() return seen diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index a1cb7b1abc0..c2d5aeb1254 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -131,7 +131,7 @@ if(detect_state) return var/datum/camerachunk/chunk = GLOB.cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z) - if(chunk && chunk.seenby.len) + if(chunk?.seenby.len) for(var/mob/camera/ai_eye/A in chunk.seenby) if(!A.ai_detector_visible) continue diff --git a/code/game/objects/items/dualsaber.dm b/code/game/objects/items/dualsaber.dm index c72bf2811e9..3e855d8d79b 100644 --- a/code/game/objects/items/dualsaber.dm +++ b/code/game/objects/items/dualsaber.dm @@ -44,7 +44,7 @@ /obj/item/dualsaber/proc/on_wield(obj/item/source, mob/living/carbon/user) SIGNAL_HANDLER - if(user && user.has_dna()) + if(user?.has_dna()) if(user.dna.check_mutation(HULK)) to_chat(user, "You lack the grace to wield this!") return COMPONENT_TWOHANDED_BLOCK_WIELD diff --git a/code/game/objects/items/grenades/plastic.dm b/code/game/objects/items/grenades/plastic.dm index 5b91dcb15b1..58fb19c513e 100644 --- a/code/game/objects/items/grenades/plastic.dm +++ b/code/game/objects/items/grenades/plastic.dm @@ -57,7 +57,7 @@ else location = get_turf(src) if(location) - if(directional && target && target.density) + if(directional && target?.density) var/turf/T = get_step(location, aim_dir) explosion(get_step(T, aim_dir), boom_sizes[1], boom_sizes[2], boom_sizes[3]) else diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index 32eef0611ce..e7c37ba09a5 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -634,7 +634,7 @@ if (!on) return if (is_type_in_typecache(target, ovens)) - if (held_sausage && held_sausage.roasted) + if (held_sausage?.roasted) to_chat("Your [held_sausage] has already been cooked!") return if (istype(target, /obj/singularity) && get_dist(user, target) < 10) diff --git a/code/game/objects/items/pinpointer.dm b/code/game/objects/items/pinpointer.dm index 5a51db7fca8..b1b9a37bdfe 100644 --- a/code/game/objects/items/pinpointer.dm +++ b/code/game/objects/items/pinpointer.dm @@ -133,7 +133,7 @@ var/crewmember_name = "Unknown" if(H.wear_id) var/obj/item/card/id/I = H.wear_id.GetID() - if(I && I.registered_name) + if(I?.registered_name) crewmember_name = I.registered_name while(crewmember_name in name_counts) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 29c70caef34..7faf696b43d 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -58,7 +58,7 @@ new type(loc, max_amount, FALSE) if(!merge_type) merge_type = type - if(custom_materials && custom_materials.len) + if(custom_materials?.len) mats_per_unit = list() var/in_process_mat_list = custom_materials.Copy() for(var/i in custom_materials) @@ -242,7 +242,7 @@ O.setDir(usr.dir) use(R.req_amount * multiplier) - if(R.applies_mats && custom_materials && custom_materials.len) + if(R.applies_mats && custom_materials?.len) var/list/used_materials = list() for(var/i in custom_materials) used_materials[SSmaterials.GetMaterialRef(i)] = R.req_amount / R.res_amount * (MINERAL_MATERIAL_AMOUNT / custom_materials.len) diff --git a/code/game/objects/items/stacks/telecrystal.dm b/code/game/objects/items/stacks/telecrystal.dm index 0a5740681ff..d5abf13210e 100644 --- a/code/game/objects/items/stacks/telecrystal.dm +++ b/code/game/objects/items/stacks/telecrystal.dm @@ -12,7 +12,7 @@ /obj/item/stack/telecrystal/attack(mob/target, mob/user) if(target == user) //You can't go around smacking people with crystals to find out if they have an uplink or not. for(var/obj/item/implant/uplink/I in target) - if(I && I.imp_in) + if(I?.imp_in) var/datum/component/uplink/hidden_uplink = I.GetComponent(/datum/component/uplink) if(hidden_uplink) hidden_uplink.telecrystals += amount diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm index 86d4d9d176d..b27640a9404 100644 --- a/code/game/objects/items/stunbaton.dm +++ b/code/game/objects/items/stunbaton.dm @@ -42,7 +42,7 @@ return cell /obj/item/melee/baton/suicide_act(mob/user) - if(cell && cell.charge && turned_on) + if(cell?.charge && turned_on) user.visible_message("[user] is putting the live [name] in [user.p_their()] mouth! It looks like [user.p_theyre()] trying to commit suicide!") . = (FIRELOSS) attack(user,user) diff --git a/code/game/objects/items/toy_mechs.dm b/code/game/objects/items/toy_mechs.dm index 3a73386709e..cfd537349dd 100644 --- a/code/game/objects/items/toy_mechs.dm +++ b/code/game/objects/items/toy_mechs.dm @@ -442,7 +442,7 @@ * * target: optional arg used in Mech PvP battles (if used, attacker is target's toy) */ /obj/item/toy/prize/proc/check_battle_start(mob/living/carbon/user, obj/item/toy/prize/attacker, mob/living/carbon/target) - if(attacker && attacker.in_combat) + if(attacker?.in_combat) to_chat(user, "[target?target.p_their() : "Your" ] [attacker.name] is in combat.") target?.to_chat(target, "Your [attacker.name] is in combat.") return FALSE diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index 1885a3da5a1..c058b4317b6 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -285,7 +285,7 @@ /obj/structure/sign/painting/update_icon_state() . = ..() - if(C && C.generated_icon) + if(C?.generated_icon) icon_state = "frame-overlay" else icon_state = "frame-empty" @@ -293,7 +293,7 @@ /obj/structure/sign/painting/update_overlays() . = ..() - if(C && C.generated_icon) + if(C?.generated_icon) var/mutable_appearance/MA = mutable_appearance(C.generated_icon) MA.pixel_x = C.framed_offset_x MA.pixel_y = C.framed_offset_y diff --git a/code/game/objects/structures/beds_chairs/alien_nest.dm b/code/game/objects/structures/beds_chairs/alien_nest.dm index 589eac4b4b7..7a20d93e80b 100644 --- a/code/game/objects/structures/beds_chairs/alien_nest.dm +++ b/code/game/objects/structures/beds_chairs/alien_nest.dm @@ -35,7 +35,7 @@ "You struggle to break free from the gelatinous resin... (Stay still for two minutes.)",\ "You hear squelching...") if(!do_after(M, 1200, target = src)) - if(M && M.buckled) + if(M?.buckled) to_chat(M, "You fail to unbuckle yourself!") return if(!M.buckled) diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm index 68cb6568c52..bc393ccbef1 100644 --- a/code/game/objects/structures/fireaxe.dm +++ b/code/game/objects/structures/fireaxe.dm @@ -51,7 +51,7 @@ else if(open || broken) if(istype(I, /obj/item/fireaxe) && !fireaxe) var/obj/item/fireaxe/F = I - if(F && F.wielded) + if(F?.wielded) to_chat(user, "Unwield the [F.name] first.") return if(!user.transferItemToLoc(F, src)) diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index f8db4b888f8..e814d2d8f85 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -48,7 +48,7 @@ /obj/structure/flora/tree/pine/Initialize() . = ..() - if(islist(icon_states && icon_states.len)) + if(islist(icon_states?.len)) icon_state = pick(icon_states) /obj/structure/flora/tree/pine/xmas diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index 9cde0769013..f42763f5336 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -102,7 +102,7 @@ "[user] is trying to pull you off [src], opening up fresh wounds!",\ "You hear a squishy wet noise.") if(!do_after(user, 300, target = src)) - if(M && M.buckled) + if(M?.buckled) M.visible_message("[user] fails to free [M]!",\ "[user] fails to pull you off of [src].") return @@ -113,7 +113,7 @@ "You hear a wet squishing noise..") M.adjustBruteLoss(30) if(!do_after(M, 1200, target = src)) - if(M && M.buckled) + if(M?.buckled) to_chat(M, "You fail to free yourself!") return if(!M.buckled) diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index bdc10a18279..4aae69dcca5 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -65,7 +65,7 @@ if(!M.ventcrawler && M.mob_size != MOB_SIZE_TINY) return FALSE var/atom/movable/M = caller - if(M && M.pulling) + if(M?.pulling) return CanAStarPass(ID, to_dir, M.pulling) return TRUE //diseases, stings, etc can pass diff --git a/code/game/turfs/open/floor/plating/asteroid.dm b/code/game/turfs/open/floor/plating/asteroid.dm index 8833d81f48f..c3244b60034 100644 --- a/code/game/turfs/open/floor/plating/asteroid.dm +++ b/code/game/turfs/open/floor/plating/asteroid.dm @@ -379,7 +379,7 @@ GLOBAL_LIST_INIT(megafauna_spawn_list, list(/mob/living/simple_animal/hostile/me if(!randumb) return while(randumb == SPAWN_MEGAFAUNA) - if((A.area_flags & MEGAFAUNA_SPAWN_ALLOWED) && megafauna_spawn_list && megafauna_spawn_list.len) //this is danger. it's boss time. + if((A.area_flags & MEGAFAUNA_SPAWN_ALLOWED) && megafauna_spawn_list?.len) //this is danger. it's boss time. var/maybe_boss = pickweight(megafauna_spawn_list) if(megafauna_spawn_list[maybe_boss]) randumb = maybe_boss diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 0f83b9798d6..93c4dd31787 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -647,7 +647,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) set name = "Remove Spell" set desc = "Remove a spell from the selected mob." - if(T && T.mind) + if(T?.mind) var/obj/effect/proc_holder/spell/S = input("Choose the spell to remove", "NO ABRAKADABRA") as null|anything in sortList(T.mind.spell_list) if(S) T.mind.RemoveSpell(S) diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 2dab412e0c4..257f38dda48 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -164,7 +164,7 @@ NOTE: it checks usr! not src! So if you're checking somebody's rank in a proc wh you will have to do something like if(client.rights & R_ADMIN) yourself. */ /proc/check_rights(rights_required, show_msg=1) - if(usr && usr.client) + if(usr?.client) if (check_rights_for(usr.client, rights_required)) return TRUE else @@ -174,7 +174,7 @@ you will have to do something like if(client.rights & R_ADMIN) yourself. //probably a bit iffy - will hopefully figure out a better solution /proc/check_if_greater_rights_than(client/other) - if(usr && usr.client) + if(usr?.client) if(usr.client.holder) if(!other || !other.holder) return TRUE @@ -183,7 +183,7 @@ you will have to do something like if(client.rights & R_ADMIN) yourself. //This proc checks whether subject has at least ONE of the rights specified in rights_required. /proc/check_rights_for(client/subject, rights_required) - if(subject && subject.holder) + if(subject?.holder) return subject.holder.check_for_rights(rights_required) return FALSE diff --git a/code/modules/admin/ipintel.dm b/code/modules/admin/ipintel.dm index 228b7997105..71c9a11acd5 100644 --- a/code/modules/admin/ipintel.dm +++ b/code/modules/admin/ipintel.dm @@ -29,7 +29,7 @@ return if (!bypasscache) var/datum/ipintel/cachedintel = SSipintel.cache[ip] - if (cachedintel && cachedintel.is_valid()) + if (cachedintel?.is_valid()) cachedintel.cache = TRUE return cachedintel diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 3e35b84f380..79ca7c5d85f 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -623,7 +623,7 @@ else if(href_list["f_dynamic_roundstart"]) if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker?.mode) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return alert(usr, "The game mode has to be dynamic mode.", null, null, null, null) @@ -706,7 +706,7 @@ if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker?.mode) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) @@ -716,7 +716,7 @@ else if(href_list["f_dynamic_roundstart_centre"]) if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker?.mode) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) @@ -733,7 +733,7 @@ else if(href_list["f_dynamic_roundstart_width"]) if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker?.mode) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) @@ -750,7 +750,7 @@ else if(href_list["f_dynamic_roundstart_latejoin_min"]) if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker?.mode) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) @@ -768,7 +768,7 @@ else if(href_list["f_dynamic_roundstart_latejoin_max"]) if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker?.mode) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) @@ -786,7 +786,7 @@ else if(href_list["f_dynamic_roundstart_midround_min"]) if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker?.mode) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) @@ -804,7 +804,7 @@ else if(href_list["f_dynamic_roundstart_midround_max"]) if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker?.mode) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) @@ -871,7 +871,7 @@ if(!check_rights(R_ADMIN)) return - if(SSticker && SSticker.mode) + if(SSticker?.mode) return alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 58747b63165..133592c1817 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -242,7 +242,7 @@ GLOBAL_LIST_EMPTY(dirty_vars) if(istype(A,type_path)) var/atom/B = A while(!(isturf(B.loc))) - if(B && B.loc) + if(B?.loc) B = B.loc else break diff --git a/code/modules/admin/view_variables/mass_edit_variables.dm b/code/modules/admin/view_variables/mass_edit_variables.dm index a4988684360..e1ee60493a0 100644 --- a/code/modules/admin/view_variables/mass_edit_variables.dm +++ b/code/modules/admin/view_variables/mass_edit_variables.dm @@ -8,7 +8,7 @@ if(!check_rights(R_VAREDIT)) return - if(A && A.type) + if(A?.type) method = vv_subtype_prompt(A.type) src.massmodify_variables(A, var_name, method) @@ -114,7 +114,7 @@ var/list/varsvars = vv_parse_text(O, new_value) var/pre_processing = new_value var/unique - if (varsvars && varsvars.len) + if (varsvars?.len) unique = alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", "Unique", "Same") if(unique == "Unique") unique = TRUE diff --git a/code/modules/admin/view_variables/modify_variables.dm b/code/modules/admin/view_variables/modify_variables.dm index a8871a64673..b9de3e09bcf 100644 --- a/code/modules/admin/view_variables/modify_variables.dm +++ b/code/modules/admin/view_variables/modify_variables.dm @@ -23,7 +23,7 @@ GLOBAL_PROTECT(VVpixelmovement) var/list/subtypes = subtypesof(type) if (!subtypes || !subtypes.len) return FALSE - if (subtypes && subtypes.len) + if (subtypes?.len) switch(alert("Strict object type detection?", "Type detection", "Strictly this type","This type and subtypes", "Cancel")) if("Strictly this type") return FALSE diff --git a/code/modules/antagonists/abductor/machinery/console.dm b/code/modules/antagonists/abductor/machinery/console.dm index 29d998e709b..e873f93e85c 100644 --- a/code/modules/antagonists/abductor/machinery/console.dm +++ b/code/modules/antagonists/abductor/machinery/console.dm @@ -143,7 +143,7 @@ return TRUE /obj/machinery/abductor/console/proc/TeleporterRetrieve() - if(pad && gizmo && gizmo.marked) + if(pad && gizmo?.marked) pad.Retrieve(gizmo.marked) /obj/machinery/abductor/console/proc/TeleporterSend() diff --git a/code/modules/antagonists/blob/blob.dm b/code/modules/antagonists/blob/blob.dm index 80acd5cefe1..69ae8604e1d 100644 --- a/code/modules/antagonists/blob/blob.dm +++ b/code/modules/antagonists/blob/blob.dm @@ -61,7 +61,7 @@ /datum/antagonist/blob/antag_listing_status() . = ..() - if(owner && owner.current) + if(owner?.current) var/mob/camera/blob/B = owner.current if(istype(B)) . += "(Progress: [B.blobs_legit.len]/[B.blobwincount])" diff --git a/code/modules/antagonists/blob/blob_mobs.dm b/code/modules/antagonists/blob/blob_mobs.dm index 4aaf15d5727..4f95aa348ee 100644 --- a/code/modules/antagonists/blob/blob_mobs.dm +++ b/code/modules/antagonists/blob/blob_mobs.dm @@ -191,7 +191,7 @@ - if(overmind && overmind.blobstrain) + if(overmind?.blobstrain) overmind.blobstrain.on_sporedeath(src) else reagents.add_reagent(/datum/reagent/toxin/spore, 10) diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm index 5ed65b97369..9a93e759c7c 100644 --- a/code/modules/antagonists/changeling/powers/fakedeath.dm +++ b/code/modules/antagonists/changeling/powers/fakedeath.dm @@ -47,9 +47,9 @@ user.regenerate_organs() /datum/action/changeling/fakedeath/proc/ready_to_regenerate(mob/user) - if(user && user.mind) + if(user?.mind) var/datum/antagonist/changeling/C = user.mind.has_antag_datum(/datum/antagonist/changeling) - if(C && C.purchasedpowers) + if(C?.purchasedpowers) to_chat(user, "We are ready to revive.") name = "Revive" desc = "We arise once more." diff --git a/code/modules/antagonists/changeling/powers/tiny_prick.dm b/code/modules/antagonists/changeling/powers/tiny_prick.dm index 0d73cc096f5..32a89387079 100644 --- a/code/modules/antagonists/changeling/powers/tiny_prick.dm +++ b/code/modules/antagonists/changeling/powers/tiny_prick.dm @@ -34,7 +34,7 @@ /mob/living/carbon/proc/unset_sting() if(mind) var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling && changeling.chosen_sting) + if(changeling?.chosen_sting) changeling.chosen_sting.unset_sting(src) /datum/action/changeling/sting/can_sting(mob/user, mob/target) diff --git a/code/modules/antagonists/creep/creep.dm b/code/modules/antagonists/creep/creep.dm index c46190026b9..1a766470f64 100644 --- a/code/modules/antagonists/creep/creep.dm +++ b/code/modules/antagonists/creep/creep.dm @@ -136,7 +136,7 @@ /datum/objective/assassinate/obsessed/update_explanation_text() ..() - if(target && target.current) + if(target?.current) explanation_text = "Murder [target.name], the [!target_role_type ? target.assigned_role : target.special_role]." else message_admins("WARNING! [ADMIN_LOOKUPFLW(owner)] obsessed objectives forged without an obsession!") @@ -148,7 +148,7 @@ /datum/objective/assassinate/jealous/update_explanation_text() ..() old = find_coworker(target) - if(target && target.current && old) + if(target?.current && old) explanation_text = "Murder [target.name], [old]'s coworker." else explanation_text = "Free Objective" @@ -210,7 +210,7 @@ if(timer == initial(timer))//just so admins can mess with it timer += pick(-600, 0) var/datum/antagonist/obsessed/creeper = owner.has_antag_datum(/datum/antagonist/obsessed) - if(target && target.current && creeper) + if(target?.current && creeper) creeper.trauma.attachedobsessedobj = src explanation_text = "Spend [DisplayTimeText(timer)] around [target.name] while they're alive." else @@ -229,7 +229,7 @@ if(!hugs_needed)//just so admins can mess with it hugs_needed = rand(4,6) var/datum/antagonist/obsessed/creeper = owner.has_antag_datum(/datum/antagonist/obsessed) - if(target && target.current && creeper) + if(target?.current && creeper) explanation_text = "Hug [target.name] [hugs_needed] times while they're alive." else explanation_text = "Free Objective" @@ -245,7 +245,7 @@ /datum/objective/polaroid/update_explanation_text() ..() - if(target && target.current) + if(target?.current) explanation_text = "Take a photo of [target.name] while they're alive." else explanation_text = "Free Objective" diff --git a/code/modules/antagonists/nukeop/clownop.dm b/code/modules/antagonists/nukeop/clownop.dm index 7d48e3f4d89..02b835da6a7 100644 --- a/code/modules/antagonists/nukeop/clownop.dm +++ b/code/modules/antagonists/nukeop/clownop.dm @@ -14,7 +14,7 @@ /datum/antagonist/nukeop/leader/clownop/give_alias() title = pick("Head Honker", "Slipmaster", "Clown King", "Honkbearer") - if(nuke_team && nuke_team.syndicate_name) + if(nuke_team?.syndicate_name) owner.current.real_name = "[nuke_team.syndicate_name] [title]" else owner.current.real_name = "Syndicate [title]" diff --git a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm index 30b3265eb0c..a2bcfc5c5a7 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclearbomb.dm @@ -457,7 +457,7 @@ safety = TRUE update_icon() sound_to_playing_players('sound/machines/alarm.ogg') - if(SSticker && SSticker.mode) + if(SSticker?.mode) SSticker.roundend_check_paused = TRUE addtimer(CALLBACK(src, .proc/actually_explode), 100) diff --git a/code/modules/antagonists/nukeop/nukeop.dm b/code/modules/antagonists/nukeop/nukeop.dm index 84a2350347c..d795a2bd8c2 100644 --- a/code/modules/antagonists/nukeop/nukeop.dm +++ b/code/modules/antagonists/nukeop/nukeop.dm @@ -75,7 +75,7 @@ nuke_team.memorized_code = null /datum/antagonist/nukeop/proc/give_alias() - if(nuke_team && nuke_team.syndicate_name) + if(nuke_team?.syndicate_name) var/mob/living/carbon/human/H = owner.current if(istype(H)) // Reinforcements get a real name var/chosen_name = H.dna.species.random_name(H.gender,0,nuke_team.syndicate_name) @@ -160,7 +160,7 @@ /datum/antagonist/nukeop/leader/memorize_code() ..() - if(nuke_team && nuke_team.memorized_code) + if(nuke_team?.memorized_code) var/obj/item/paper/P = new P.info = "The nuclear authorization code is: [nuke_team.memorized_code]" P.name = "nuclear bomb code" @@ -173,7 +173,7 @@ /datum/antagonist/nukeop/leader/give_alias() title = pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord") - if(nuke_team && nuke_team.syndicate_name) + if(nuke_team?.syndicate_name) owner.current.real_name = "[nuke_team.syndicate_name] [title]" else owner.current.real_name = "Syndicate [title]" diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index 31b60e7891b..727029f3633 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -267,7 +267,7 @@ dna.open_machine() for(var/obj/structure/window/window in T) window.take_damage(rand(30,80)) - if(window && window.fulltile) + if(window?.fulltile) new /obj/effect/temp_visual/revenant/cracks(window.loc) for(var/obj/machinery/light/light in T) light.flicker(20) //spooky diff --git a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm index 70eddbd9d23..fcde36aa9c6 100644 --- a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm +++ b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm @@ -404,7 +404,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) return ranged_ability_user.playsound_local(ranged_ability_user, 'sound/misc/interference.ogg', 50, 0) attached_action.adjust_uses(-1) - if(attached_action && attached_action.uses) + if(attached_action?.uses) attached_action.desc = "[initial(attached_action.desc)] It has [attached_action.uses] use\s remaining." attached_action.UpdateButtonIcon() target.audible_message("You hear a loud electrical buzzing sound coming from [target]!") @@ -487,7 +487,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) return ranged_ability_user.playsound_local(ranged_ability_user, "sparks", 50, 0) attached_action.adjust_uses(-1) - if(attached_action && attached_action.uses) + if(attached_action?.uses) attached_action.desc = "[initial(attached_action.desc)] It has [attached_action.uses] use\s remaining." attached_action.UpdateButtonIcon() target.audible_message("You hear a loud electrical buzzing sound coming from [target]!") diff --git a/code/modules/antagonists/traitor/syndicate_contract.dm b/code/modules/antagonists/traitor/syndicate_contract.dm index e6b05c4a647..64c45c0414d 100644 --- a/code/modules/antagonists/traitor/syndicate_contract.dm +++ b/code/modules/antagonists/traitor/syndicate_contract.dm @@ -146,7 +146,7 @@ H = contract.owner.current C = H.get_idcard(TRUE) - if(C && C.registered_account) + if(C?.registered_account) C.registered_account.adjust_money(ransom * 0.35) C.registered_account.bank_card_talk("We've processed the ransom, agent. Here's your cut - your balance is now \ diff --git a/code/modules/antagonists/wizard/equipment/soulstone.dm b/code/modules/antagonists/wizard/equipment/soulstone.dm index c2670e5d477..97bf0d851ab 100644 --- a/code/modules/antagonists/wizard/equipment/soulstone.dm +++ b/code/modules/antagonists/wizard/equipment/soulstone.dm @@ -174,7 +174,7 @@ if("VICTIM") var/mob/living/carbon/human/T = target var/datum/antagonist/cult/C = user.mind.has_antag_datum(/datum/antagonist/cult,TRUE) - if(C && C.cult_team.is_sacrifice_target(T.mind)) + if(C?.cult_team.is_sacrifice_target(T.mind)) if(iscultist(user)) to_chat(user, "\"This soul is mine. SACRIFICE THEM!\"") else @@ -281,7 +281,7 @@ SM.Grant(newstruct) newstruct.key = target.key var/obj/screen/alert/bloodsense/BS - if(newstruct.mind && ((stoner && iscultist(stoner)) || cultoverride) && SSticker && SSticker.mode) + if(newstruct.mind && ((stoner && iscultist(stoner)) || cultoverride) && SSticker?.mode) SSticker.mode.add_cultist(newstruct.mind, 0) if(iscultist(stoner) || cultoverride) to_chat(newstruct, "You are still bound to serve the cult[stoner ? " and [stoner]":""], follow [stoner ? stoner.p_their() : "their"] orders and help [stoner ? stoner.p_them() : "them"] complete [stoner ? stoner.p_their() : "their"] goals at all costs.") diff --git a/code/modules/antagonists/wizard/equipment/spellbook.dm b/code/modules/antagonists/wizard/equipment/spellbook.dm index aee416db91b..0f0ee164ea3 100644 --- a/code/modules/antagonists/wizard/equipment/spellbook.dm +++ b/code/modules/antagonists/wizard/equipment/spellbook.dm @@ -756,14 +756,14 @@ H.set_machine(src) if(href_list["buy"]) E = entries[text2num(href_list["buy"])] - if(E && E.CanBuy(H,src)) + if(E?.CanBuy(H,src)) if(E.Buy(H,src)) if(E.limit) E.limit-- uses -= E.cost else if(href_list["refund"]) E = entries[text2num(href_list["refund"])] - if(E && E.refundable) + if(E?.refundable) var/result = E.Refund(H,src) if(result > 0) if(!isnull(E.limit)) diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 3f5d8afcdbc..61967805c59 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -330,7 +330,7 @@ var/obj/item/organ/cyberimp/arm/flash/I = null /obj/item/assembly/flash/armimplant/burn_out() - if(I && I.owner) + if(I?.owner) to_chat(I.owner, "Your photon projector implant overheats and deactivates!") I.Retract() overheat = TRUE @@ -338,7 +338,7 @@ /obj/item/assembly/flash/armimplant/try_use_flash(mob/user = null) if(overheat) - if(I && I.owner) + if(I?.owner) to_chat(I.owner, "Your photon projector is running too hot to be used again so quickly!") return FALSE overheat = TRUE diff --git a/code/modules/assembly/health.dm b/code/modules/assembly/health.dm index 0af6c85fb6b..31c6b0db584 100644 --- a/code/modules/assembly/health.dm +++ b/code/modules/assembly/health.dm @@ -43,7 +43,7 @@ return var/atom/A = src - if(connected && connected.holder) + if(connected?.holder) A = connected.holder for(A, A && !ismob(A), A=A.loc); // like get_turf(), but for mobs. diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index e8c6ca96080..346b48d633e 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -90,10 +90,10 @@ nobiliumsuppression = INFINITY var/turf/open/location = isturf(holder) ? holder : null . = NO_REACTION if (air.temperature <= WATER_VAPOR_FREEZE) - if(location && location.freon_gas_act()) + if(location?.freon_gas_act()) . = REACTING else if(air.temperature <= T20C + 10) - if(location && location.water_vapor_gas_act()) + if(location?.water_vapor_gas_act()) air.gases[/datum/gas/water_vapor][MOLES] -= MOLES_GAS_VISIBLE . = REACTING diff --git a/code/modules/atmospherics/machinery/datum_pipeline.dm b/code/modules/atmospherics/machinery/datum_pipeline.dm index a0deaf58f32..a78d0022dfd 100644 --- a/code/modules/atmospherics/machinery/datum_pipeline.dm +++ b/code/modules/atmospherics/machinery/datum_pipeline.dm @@ -15,7 +15,7 @@ /datum/pipeline/Destroy() SSair.networks -= src - if(air && air.volume) + if(air?.volume) temporarily_store_air() for(var/obj/machinery/atmospherics/pipe/P in members) P.parent = null @@ -46,7 +46,7 @@ while(possible_expansions.len) for(var/obj/machinery/atmospherics/borderline in possible_expansions) var/list/result = borderline.pipeline_expansion(src) - if(result && result.len) + if(result?.len) for(var/obj/machinery/atmospherics/P in result) if(istype(P, /obj/machinery/atmospherics/pipe)) var/obj/machinery/atmospherics/pipe/item = P diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index de3ffd368ff..09ec7ca281f 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -306,7 +306,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations) try_to_connect(D) return TRUE if("deactivate") - if(G && G.target) + if(G?.target) G.deactivate() return TRUE diff --git a/code/modules/cargo/blackmarket/blackmarket_uplink.dm b/code/modules/cargo/blackmarket/blackmarket_uplink.dm index 46b1acc99ce..dbf02989363 100644 --- a/code/modules/cargo/blackmarket/blackmarket_uplink.dm +++ b/code/modules/cargo/blackmarket/blackmarket_uplink.dm @@ -19,7 +19,7 @@ if(accessible_markets.len) viewing_market = accessible_markets[1] var/list/categories = SSblackmarket.markets[viewing_market].categories - if(categories && categories.len) + if(categories?.len) viewing_category = categories[1] /obj/item/blackmarket_uplink/attackby(obj/item/I, mob/user, params) @@ -121,7 +121,7 @@ viewing_market = market var/list/categories = SSblackmarket.markets[viewing_market].categories - if(categories && categories.len) + if(categories?.len) viewing_category = categories[1] else viewing_category = null diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm index 738ae603b42..9841ead03e9 100644 --- a/code/modules/cargo/expressconsole.dm +++ b/code/modules/cargo/expressconsole.dm @@ -193,7 +193,7 @@ continue LAZYADD(empty_turfs, T) CHECK_TICK - if(empty_turfs && empty_turfs.len) + if(empty_turfs?.len) LZ = pick(empty_turfs) if (SO.pack.cost <= points_to_check && LZ)//we need to call the cost check again because of the CHECK_TICK call TIMER_COOLDOWN_START(src, COOLDOWN_EXPRESSPOD_CONSOLE, 5 SECONDS) @@ -209,7 +209,7 @@ continue LAZYADD(empty_turfs, T) CHECK_TICK - if(empty_turfs && empty_turfs.len) + if(empty_turfs?.len) TIMER_COOLDOWN_START(src, COOLDOWN_EXPRESSPOD_CONSOLE, 10 SECONDS) D.adjust_money(-(SO.pack.cost * (0.72*MAX_EMAG_ROCKETS))) diff --git a/code/modules/cargo/order.dm b/code/modules/cargo/order.dm index f6823cf847e..cd051881a2b 100644 --- a/code/modules/cargo/order.dm +++ b/code/modules/cargo/order.dm @@ -16,7 +16,7 @@ errors |= MANIFEST_ERROR_ITEM /obj/item/paper/fluff/jobs/cargo/manifest/proc/is_approved() - return stamped && stamped.len && !is_denied() + return stamped?.len && !is_denied() /obj/item/paper/fluff/jobs/cargo/manifest/proc/is_denied() return stamped && ("stamp-deny" in stamped) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index a7a1e29dc9e..6c43253e2e5 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1117,7 +1117,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) continue ban_details = i break //we only want to get the most recent ban's details - if(ban_details && ban_details.len) + if(ban_details?.len) var/expires = "This is a permanent ban." if(ban_details["expiration_time"]) expires = " The ban is for [DisplayTimeText(text2num(ban_details["duration"]) MINUTES)] and expires on [ban_details["expiration_time"]] (server time)." @@ -1797,7 +1797,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("ambientocclusion") ambientocclusion = !ambientocclusion - if(parent && parent.screen && parent.screen.len) + if(parent?.screen && parent.screen.len) var/obj/screen/plane_master/game_world/PM = locate(/obj/screen/plane_master/game_world) in parent.screen PM.backdrop(parent.mob) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index c955023c9c3..61536b6d634 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -481,7 +481,7 @@ /mob/living/carbon/human/proc/update_glasses_color(obj/item/clothing/glasses/G, glasses_equipped) - if(client && client.prefs.uses_glasses_colour && glasses_equipped) + if(client?.prefs.uses_glasses_colour && glasses_equipped) add_client_colour(G.glass_colour_type) else remove_client_colour(G.glass_colour_type) diff --git a/code/modules/clothing/masks/_masks.dm b/code/modules/clothing/masks/_masks.dm index 1ccb2c3c176..992e30a4ecd 100644 --- a/code/modules/clothing/masks/_masks.dm +++ b/code/modules/clothing/masks/_masks.dm @@ -45,7 +45,7 @@ //Proc that moves gas/breath masks out of the way, disabling them and allowing pill/food consumption /obj/item/clothing/mask/proc/adjustmask(mob/living/user) - if(user && user.incapacitated()) + if(user?.incapacitated()) return mask_adjusted = !mask_adjusted if(!mask_adjusted) diff --git a/code/modules/clothing/spacesuits/_spacesuits.dm b/code/modules/clothing/spacesuits/_spacesuits.dm index 945c4b9baff..3bd40e84ecd 100644 --- a/code/modules/clothing/spacesuits/_spacesuits.dm +++ b/code/modules/clothing/spacesuits/_spacesuits.dm @@ -170,7 +170,7 @@ /// Remove the cell whent he cover is open on CTRL+Click /obj/item/clothing/suit/space/CtrlClick(mob/living/user) - if(user && user.canUseTopic(src, BE_CLOSE, ismonkey(user))) + if(user?.canUseTopic(src, BE_CLOSE, ismonkey(user))) if(cell_cover_open && cell) remove_cell(user) return diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm index 34b40dd797e..00e71fc0d6a 100644 --- a/code/modules/clothing/spacesuits/chronosuit.dm +++ b/code/modules/clothing/spacesuits/chronosuit.dm @@ -261,7 +261,7 @@ return /obj/effect/chronos_cam/proc/create_target_ui() - if(holder && holder.client && chronosuit) + if(holder?.client && chronosuit) if(target_ui) remove_target_ui() target_ui = new(src, holder) diff --git a/code/modules/detectivework/footprints_and_rag.dm b/code/modules/detectivework/footprints_and_rag.dm index 6bb864262df..575006c8439 100644 --- a/code/modules/detectivework/footprints_and_rag.dm +++ b/code/modules/detectivework/footprints_and_rag.dm @@ -24,7 +24,7 @@ . = ..() if(!proximity) return - if(iscarbon(A) && A.reagents && reagents.total_volume) + if(iscarbon(A) && A.reagents?.total_volume) var/mob/living/carbon/C = A var/reagentlist = pretty_string_from_reagent_list(reagents) var/log_object = "containing [reagentlist]" diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm index 039fffd03f7..5c749a76cae 100644 --- a/code/modules/error_handler/error_handler.dm +++ b/code/modules/error_handler/error_handler.dm @@ -18,14 +18,14 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0) //if we got to here without silently ending, the byond bug has been fixed. log_world("The bug with recursion runtimes has been fixed. Please remove the snowflake check from world/Error in [__FILE__]:[__LINE__]") return //this will never happen. - + else if(copytext(E.name, 1, 18) == "Out of resources!")//18 == length() of that string + 1 log_world("BYOND out of memory. Restarting") log_game("BYOND out of memory. Restarting") TgsEndProcess() Reboot(reason = 1) return ..() - + if (islist(stack_trace_storage)) for (var/line in splittext(E.desc, "\n")) if (text2ascii(line) != 32) @@ -59,7 +59,7 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0) var/configured_error_cooldown var/configured_error_limit var/configured_error_silence_time - if(config && config.entries) + if(config?.entries) configured_error_cooldown = CONFIG_GET(number/error_cooldown) configured_error_limit = CONFIG_GET(number/error_limit) configured_error_silence_time = CONFIG_GET(number/error_silence_time) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 309324b2193..499ffb963c9 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -461,7 +461,7 @@ growth_queue += SV vines += SV SV.master = src - if(muts && muts.len) + if(muts?.len) for(var/datum/spacevine_mutation/M in muts) M.add_mutation_to_vinepiece(SV) if(parent) diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index ce5b4a00e77..9e71b1314a2 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -68,7 +68,7 @@ All foods are distributed among various categories. Use common sense. return COMSIG_FRYING_HANDLED /obj/item/reagent_containers/food/snacks/add_initial_reagents() - if(tastes && tastes.len) + if(tastes?.len) if(list_reagents) for(var/rid in list_reagents) var/amount = list_reagents[rid] @@ -216,7 +216,7 @@ All foods are distributed among various categories. Use common sense. qdel(A) SSblackbox.record_feedback("tally", "food_made", 1, type) - if(bonus_reagents && bonus_reagents.len) + if(bonus_reagents?.len) for(var/r_id in bonus_reagents) var/amount = bonus_reagents[r_id] if(r_id == /datum/reagent/consumable/nutriment || r_id == /datum/reagent/consumable/nutriment/vitamin || r_id == /datum/reagent/consumable/nutriment/protein) diff --git a/code/modules/food_and_drinks/food/snacks_other.dm b/code/modules/food_and_drinks/food/snacks_other.dm index 9e9caadff1b..dee86d19a61 100644 --- a/code/modules/food_and_drinks/food/snacks_other.dm +++ b/code/modules/food_and_drinks/food/snacks_other.dm @@ -490,7 +490,7 @@ qdel(src) return succ_dur -= delta_time - if((reagents && reagents.total_volume) && (next_succ <= world.time)) + if((reagents?.total_volume) && (next_succ <= world.time)) handle_reagents() next_succ = world.time + succ_int diff --git a/code/modules/food_and_drinks/food/snacks_pie.dm b/code/modules/food_and_drinks/food/snacks_pie.dm index 39162f8a5c1..dc964908a6e 100644 --- a/code/modules/food_and_drinks/food/snacks_pie.dm +++ b/code/modules/food_and_drinks/food/snacks_pie.dm @@ -41,7 +41,7 @@ return var/turf/T = get_turf(hit_atom) new/obj/effect/decal/cleanable/food/pie_smudge(T) - if(reagents && reagents.total_volume) + if(reagents?.total_volume) reagents.expose(hit_atom, TOUCH) if(isliving(hit_atom)) var/mob/living/L = hit_atom diff --git a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm index 16dab83aa68..a54bac8491f 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm @@ -111,7 +111,7 @@ if(product_types[dispense_flavour] > 0) visible_message("[icon2html(src, viewers(src))] [user] scoops delicious [flavour_name] ice cream into [I].") product_types[dispense_flavour] -= 1 - if(beaker && beaker.reagents.total_volume) + if(beaker?.reagents.total_volume) I.add_ice_cream(flavour_name, beaker.reagents) else I.add_ice_cream(flavour_name) diff --git a/code/modules/food_and_drinks/recipes/food_mixtures.dm b/code/modules/food_and_drinks/recipes/food_mixtures.dm index 773b8965169..6746c48be6b 100644 --- a/code/modules/food_and_drinks/recipes/food_mixtures.dm +++ b/code/modules/food_and_drinks/recipes/food_mixtures.dm @@ -101,7 +101,7 @@ /datum/chemical_reaction/imitationcarpmeat/on_reaction(datum/reagents/holder) var/location = get_turf(holder.my_atom) new /obj/item/food/carpmeat/imitation(location) - if(holder && holder.my_atom) + if(holder?.my_atom) qdel(holder.my_atom) /datum/chemical_reaction/dough @@ -133,7 +133,7 @@ /datum/chemical_reaction/ricebowl/on_reaction(datum/reagents/holder) var/location = get_turf(holder.my_atom) new /obj/item/food/salad/ricebowl(location) - if(holder && holder.my_atom) + if(holder?.my_atom) qdel(holder.my_atom) /datum/chemical_reaction/nutriconversion diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index f4d3dd477ba..f02c7df8540 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -97,7 +97,7 @@ // Various gene procs /obj/item/reagent_containers/food/snacks/grown/attack_self(mob/user) - if(seed && seed.get_gene(/datum/plant_gene/trait/squash)) + if(seed?.get_gene(/datum/plant_gene/trait/squash)) squash(user) ..() @@ -156,7 +156,7 @@ /obj/item/reagent_containers/food/snacks/grown/on_grind() var/nutriment = reagents.get_reagent_amount(/datum/reagent/consumable/nutriment) - if(grind_results&&grind_results.len) + if(grind_results?.len) for(var/i in 1 to grind_results.len) grind_results[grind_results[i]] = nutriment reagents.del_reagent(/datum/reagent/consumable/nutriment) @@ -164,7 +164,7 @@ /obj/item/reagent_containers/food/snacks/grown/on_juice() var/nutriment = reagents.get_reagent_amount(/datum/reagent/consumable/nutriment) - if(juice_results&&juice_results.len) + if(juice_results?.len) for(var/i in 1 to juice_results.len) juice_results[juice_results[i]] = nutriment reagents.del_reagent(/datum/reagent/consumable/nutriment) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 9d68a562da2..9daf02eef46 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -310,7 +310,7 @@ update_icon_lights() if(!self_sustaining) - if(myseed && myseed.get_gene(/datum/plant_gene/trait/glow)) + if(myseed?.get_gene(/datum/plant_gene/trait/glow)) var/datum/plant_gene/trait/glow/G = myseed.get_gene(/datum/plant_gene/trait/glow) set_light(G.glow_range(myseed), G.glow_power(myseed), G.glow_color) else diff --git a/code/modules/mining/lavaland/ash_flora.dm b/code/modules/mining/lavaland/ash_flora.dm index b68ff57a418..c9b701facb3 100644 --- a/code/modules/mining/lavaland/ash_flora.dm +++ b/code/modules/mining/lavaland/ash_flora.dm @@ -349,7 +349,7 @@ /obj/item/reagent_containers/glass/bowl/mushroom_bowl/update_overlays() . = ..() - if(reagents && reagents.total_volume) + if(reagents?.total_volume) var/mutable_appearance/filling = mutable_appearance('icons/obj/lavaland/ash_flora.dmi', "fullbowl") filling.color = mix_color_from_reagents(reagents.reagent_list) . += filling diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 4f39aa51e65..ac6d297dbb9 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -52,7 +52,7 @@ if(O.refined_type == null) return - if(O && O.refined_type) + if(O?.refined_type) points += O.points * point_upgrade * O.amount var/material_amount = mat_container.get_item_material_amount(O, BREAKDOWN_FLAGS_ORM) diff --git a/code/modules/mining/minebot.dm b/code/modules/mining/minebot.dm index 3d80f895a91..335a74754a8 100644 --- a/code/modules/mining/minebot.dm +++ b/code/modules/mining/minebot.dm @@ -83,7 +83,7 @@ . += "[t_He] look[t_s] severely dented!" . += {"Using a mining scanner on [t_him] will instruct [t_him] to drop stored ore. [max(0, LAZYLEN(contents) - 1)] Stored Ore\n Field repairs can be done with a welder."} - if(stored_gun && stored_gun.max_mod_capacity) + if(stored_gun?.max_mod_capacity) . += "[stored_gun.get_remaining_mod_capacity()]% mod capacity remaining." for(var/A in stored_gun.get_modkits()) var/obj/item/borg/upgrade/modkit/M = A diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 3ac17481199..077c683ee8a 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -161,7 +161,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) /mob/dead/observer/Destroy() // Update our old body's medhud since we're abandoning it - if(mind && mind.current) + if(mind?.current) mind.current.med_hud_set_status() GLOB.ghost_images_default -= ghostimage_default @@ -640,7 +640,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(src, "This creature is too powerful for you to possess!") return FALSE - if(can_reenter_corpse && mind && mind.current) + if(can_reenter_corpse && mind?.current) if(alert(src, "Your soul is still tied to your former life as [mind.current.name], if you go forward there is no going back to that life. Are you sure you wish to continue?", "Move On", "Yes", "No") == "No") return FALSE if(target.key) @@ -778,7 +778,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set category = "Ghost" set_ghost_appearance() - if(client && client.prefs) + if(client?.prefs) deadchat_name = client.prefs.real_name if(mind) mind.ghostname = client.prefs.real_name diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index 6b89f3ddd37..1c777dcf672 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -86,7 +86,7 @@ var/obj/vehicle/sealed/mecha/M = container.mecha if(M.mouse_pointer) client.mouse_pointer_icon = M.mouse_pointer - if (client && ranged_ability && ranged_ability.ranged_mousepointer) + if (client && ranged_ability?.ranged_mousepointer) client.mouse_pointer_icon = ranged_ability.ranged_mousepointer /mob/living/brain/proc/get_traumas() diff --git a/code/modules/mob/living/brain/life.dm b/code/modules/mob/living/brain/life.dm index 4128235e45a..e78c9c8a801 100644 --- a/code/modules/mob/living/brain/life.dm +++ b/code/modules/mob/living/brain/life.dm @@ -14,7 +14,7 @@ if(stat != DEAD) death() var/obj/item/organ/brain/BR - if(container && container.brain) + if(container?.brain) BR = container.brain else if(istype(loc, /obj/item/organ/brain)) BR = loc diff --git a/code/modules/mob/living/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm index 5d82400b04f..10237885e14 100644 --- a/code/modules/mob/living/brain/posibrain.dm +++ b/code/modules/mob/living/brain/posibrain.dm @@ -159,7 +159,7 @@ GLOBAL_VAR(posibrain_notify_cooldown) /obj/item/mmi/posibrain/examine(mob/user) . = ..() - if(brainmob && brainmob.key) + if(brainmob?.key) switch(brainmob.stat) if(CONSCIOUS) if(!brainmob.client) @@ -195,7 +195,7 @@ GLOBAL_VAR(posibrain_notify_cooldown) /obj/item/mmi/posibrain/update_icon_state() if(searching) icon_state = "[initial(icon_state)]-searching" - else if(brainmob && brainmob.key) + else if(brainmob?.key) icon_state = "[initial(icon_state)]-occupied" else icon_state = initial(icon_state) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 2eacebc179f..c24e782c972 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -348,7 +348,7 @@ if (handcuffed) var/obj/item/W = handcuffed set_handcuffed(null) - if (buckled && buckled.buckle_requires_restraints) + if (buckled?.buckle_requires_restraints) buckled.unbuckle_mob(src) update_handcuffed() if (client) @@ -393,7 +393,7 @@ handcuffed.forceMove(drop_location()) set_handcuffed(null) I.dropped(src) - if(buckled && buckled.buckle_requires_restraints) + if(buckled?.buckle_requires_restraints) buckled.unbuckle_mob(src) update_handcuffed() return TRUE @@ -801,11 +801,11 @@ hud_used.healths.icon_state = "health7" /mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0) - if(hud_used && hud_used.internals) + if(hud_used?.internals) hud_used.internals.icon_state = "internal[internal_state]" /mob/living/carbon/proc/update_spacesuit_hud_icon(cell_state = "empty") - if(hud_used && hud_used.spacesuit) + if(hud_used?.spacesuit) hud_used.spacesuit.icon_state = "spacesuit_[cell_state]" diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index 47dae074fbd..a8723e43e84 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -57,7 +57,7 @@ if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) I.screen_loc = ui_hand_position(get_held_index_of_item(I)) client.screen += I - if(observers && observers.len) + if(observers?.len) for(var/M in observers) var/mob/dead/observe = M if(observe.client && observe.client.eye == src) @@ -112,7 +112,7 @@ if(!get_bodypart(BODY_ZONE_HEAD)) //Decapitated return - if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_MASK) + 1]) + if(client && hud_used?.inv_slots[TOBITSHIFT(ITEM_SLOT_MASK) + 1]) var/obj/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_MASK) + 1] inv.update_icon() @@ -128,7 +128,7 @@ /mob/living/carbon/update_inv_neck() remove_overlay(NECK_LAYER) - if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_NECK) + 1]) + if(client && hud_used?.inv_slots[TOBITSHIFT(ITEM_SLOT_NECK) + 1]) var/obj/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_NECK) + 1] inv.update_icon() @@ -142,7 +142,7 @@ /mob/living/carbon/update_inv_back() remove_overlay(BACK_LAYER) - if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1]) + if(client && hud_used?.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1]) var/obj/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1] inv.update_icon() @@ -160,7 +160,7 @@ if(!get_bodypart(BODY_ZONE_HEAD)) //Decapitated return - if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1]) + if(client && hud_used?.inv_slots[TOBITSHIFT(ITEM_SLOT_BACK) + 1]) var/obj/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_HEAD) + 1] inv.update_icon() diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index eec33b98bf3..d00cba54e68 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -101,7 +101,7 @@ if(fire_stacks < 0) msg += "[t_He] look[p_s()] a little soaked.\n" - if(pulledby && pulledby.grab_state) + if(pulledby?.grab_state) msg += "[t_He] [t_is] restrained by [pulledby]'s grip.\n" var/scar_severity = 0 diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index b4019c05bbf..8ac522d7d34 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -237,7 +237,7 @@ msg += "[t_He] look[p_s()] a little soaked.\n" - if(pulledby && pulledby.grab_state) + if(pulledby?.grab_state) msg += "[t_He] [t_is] restrained by [pulledby]'s grip.\n" if(nutrition < NUTRITION_LEVEL_STARVING - 50) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ddf619f3534..aa2216844c9 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -188,7 +188,7 @@ dat += "" var/obj/item/bodypart/O = get_bodypart(BODY_ZONE_CHEST) - if((w_uniform == null && !(dna && dna.species.nojumpsuit) && !(O && O.status == BODYPART_ROBOTIC)) || (obscured & ITEM_SLOT_ICLOTHING)) + if((w_uniform == null && !(dna?.species.nojumpsuit) && (!O || O.status != BODYPART_ROBOTIC)) || (obscured & ITEM_SLOT_ICLOTHING)) dat += " ↳Pockets:" dat += " ↳ID:" dat += " ↳Belt:" @@ -604,7 +604,7 @@ if(judgement_criteria & JUDGE_RECORDCHECK) var/perpname = get_face_name(get_id_name()) var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security) - if(R && R.fields["criminal"]) + if(R?.fields["criminal"]) switch(R.fields["criminal"]) if("*Arrest*") threatcount += 5 @@ -717,7 +717,7 @@ #undef CPR_PANIC_SPEED /mob/living/carbon/human/cuff_resist(obj/item/I) - if(dna && dna.check_mutation(HULK)) + if(dna?.check_mutation(HULK)) say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ), forced = "hulk") if(..(I, cuff_break = FAST_CUFFBREAK)) dropItemToGround(I) @@ -806,7 +806,7 @@ //Just like a cartoon! /mob/living/carbon/human/proc/electrocution_animation(anim_duration) //Handle mutant parts if possible - if(dna && dna.species) + if(dna?.species) add_atom_colour("#000000", TEMPORARY_COLOUR_PRIORITY) var/static/mutable_appearance/electrocution_skeleton_anim if(!electrocution_skeleton_anim) @@ -834,7 +834,7 @@ return TRUE /mob/living/carbon/human/resist_restraints() - if(wear_suit && wear_suit.breakouttime) + if(wear_suit?.breakouttime) changeNext_move(CLICK_CD_BREAKOUT) last_special = world.time + CLICK_CD_BREAKOUT cuff_resist(wear_suit) @@ -929,7 +929,7 @@ return TRUE /mob/living/carbon/human/update_gravity(has_gravity,override = 0) - if(dna && dna.species) //prevents a runtime while a human is being monkeyfied + if(dna?.species) //prevents a runtime while a human is being monkeyfied override = dna.species.override_float ..() diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index aac1beb44b5..d1466f8f167 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -49,12 +49,12 @@ return covering_part /mob/living/carbon/human/on_hit(obj/projectile/P) - if(dna && dna.species) + if(dna?.species) dna.species.on_hit(P, src) /mob/living/carbon/human/bullet_act(obj/projectile/P, def_zone) - if(dna && dna.species) + if(dna?.species) var/spec_return = dna.species.bullet_act(P, src) if(spec_return) return spec_return @@ -141,7 +141,7 @@ return FALSE /mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) - if(dna && dna.species) + if(dna?.species) var/spec_return = dna.species.spec_hitby(AM, src) if(spec_return) return spec_return diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index d0bea4f15b3..30254dc6e88 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -147,7 +147,7 @@ var/datum/bank_account/account var/obj/item/card/id/I = get_idcard() - if(I && I.registered_account) + if(I?.registered_account) account = I.registered_account return account diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 2551cef7ee6..359b0b56947 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -41,7 +41,7 @@ . = 1 /mob/living/carbon/human/mob_negates_gravity() - return ((shoes && shoes.negates_gravity()) || (dna.species.negates_gravity(src))) + return ((shoes?.negates_gravity()) || (dna.species.negates_gravity(src))) /mob/living/carbon/human/Move(NewLoc, direct) . = ..() diff --git a/code/modules/mob/living/carbon/human/human_say.dm b/code/modules/mob/living/carbon/human/human_say.dm index 93232e5e0e1..952f819a2f1 100644 --- a/code/modules/mob/living/carbon/human/human_say.dm +++ b/code/modules/mob/living/carbon/human/human_say.dm @@ -27,7 +27,7 @@ return real_name if(mind) var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling && changeling.mimicing ) + if(changeling?.mimicing ) return changeling.mimicing if(GetSpecialVoice()) return GetSpecialVoice() diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index 1f8b9f4042d..53e1ee4944d 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -109,7 +109,7 @@ There are several things that need to be remembered: if(istype(w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/U = w_uniform U.screen_loc = ui_iclothing - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) if(hud_used.inventory_shown) client.screen += w_uniform update_observer_view(w_uniform,1) @@ -127,7 +127,7 @@ There are several things that need to be remembered: var/mutable_appearance/uniform_overlay - if(dna && dna.species.sexes) + if(dna?.species.sexes) if(body_type == FEMALE && U.fitted != NO_FEMALE_UNIFORM) uniform_overlay = U.build_worn_icon(default_layer = UNIFORM_LAYER, default_icon_file = 'icons/mob/clothing/under/default.dmi', isinhands = FALSE, femaleuniform = U.fitted, override_state = target_overlay) @@ -156,7 +156,7 @@ There are several things that need to be remembered: if(wear_id) wear_id.screen_loc = ui_id - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) client.screen += wear_id update_observer_view(wear_id) @@ -173,7 +173,7 @@ There are several things that need to be remembered: /mob/living/carbon/human/update_inv_gloves() remove_overlay(GLOVES_LAYER) - if(client && hud_used && hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_GLOVES) + 1]) + if(client && hud_used?.inv_slots[TOBITSHIFT(ITEM_SLOT_GLOVES) + 1]) var/obj/screen/inventory/inv = hud_used.inv_slots[TOBITSHIFT(ITEM_SLOT_GLOVES) + 1] inv.update_icon() @@ -190,7 +190,7 @@ There are several things that need to be remembered: var/mutable_appearance/gloves_overlay = overlays_standing[GLOVES_LAYER] if(gloves) gloves.screen_loc = ui_gloves - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) if(hud_used.inventory_shown) client.screen += gloves update_observer_view(gloves,1) @@ -217,7 +217,7 @@ There are several things that need to be remembered: if(glasses) glasses.screen_loc = ui_glasses //...draw the item in the inventory screen - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) if(hud_used.inventory_shown) //if the inventory is open ... client.screen += glasses //Either way, add the item to the HUD update_observer_view(glasses,1) @@ -247,7 +247,7 @@ There are several things that need to be remembered: if(ears) ears.screen_loc = ui_ears //move the item to the appropriate screen loc - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) if(hud_used.inventory_shown) //if the inventory is open client.screen += ears //add it to the client's screen update_observer_view(ears,1) @@ -274,7 +274,7 @@ There are several things that need to be remembered: if(shoes) shoes.screen_loc = ui_shoes //move the item to the appropriate screen loc - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) if(hud_used.inventory_shown) //if the inventory is open client.screen += shoes //add it to client's screen update_observer_view(shoes,1) @@ -299,7 +299,7 @@ There are several things that need to be remembered: if(s_store) s_store.screen_loc = ui_sstore1 - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) client.screen += s_store update_observer_view(s_store) overlays_standing[SUIT_STORE_LAYER] = s_store.build_worn_icon(default_layer = SUIT_STORE_LAYER, default_icon_file = 'icons/mob/clothing/belt_mirror.dmi') @@ -332,7 +332,7 @@ There are several things that need to be remembered: if(belt) belt.screen_loc = ui_belt - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) client.screen += belt update_observer_view(belt) overlays_standing[BELT_LAYER] = belt.build_worn_icon(default_layer = BELT_LAYER, default_icon_file = 'icons/mob/clothing/belt.dmi') @@ -357,7 +357,7 @@ There are several things that need to be remembered: if(istype(wear_suit, /obj/item/clothing/suit)) wear_suit.screen_loc = ui_oclothing - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) if(hud_used.inventory_shown) client.screen += wear_suit update_observer_view(wear_suit,1) @@ -451,7 +451,7 @@ There are several things that need to be remembered: //update whether our head item appears on our hud. /mob/living/carbon/human/update_hud_head(obj/item/I) I.screen_loc = ui_head - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) if(hud_used.inventory_shown) client.screen += I update_observer_view(I,1) @@ -459,7 +459,7 @@ There are several things that need to be remembered: //update whether our mask item appears on our hud. /mob/living/carbon/human/update_hud_wear_mask(obj/item/I) I.screen_loc = ui_mask - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) if(hud_used.inventory_shown) client.screen += I update_observer_view(I,1) @@ -467,7 +467,7 @@ There are several things that need to be remembered: //update whether our neck item appears on our hud. /mob/living/carbon/human/update_hud_neck(obj/item/I) I.screen_loc = ui_neck - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) if(hud_used.inventory_shown) client.screen += I update_observer_view(I,1) @@ -475,7 +475,7 @@ There are several things that need to be remembered: //update whether our back item appears on our hud. /mob/living/carbon/human/update_hud_back(obj/item/I) I.screen_loc = ui_back - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) client.screen += I update_observer_view(I) @@ -530,7 +530,7 @@ generate/load female uniform sprites matching all previously decided variables //Get the overlays for this item when it's being worn //eg: ammo counters, primed grenade flashes, etc. var/list/worn_overlays = worn_overlays(isinhands, file2use) - if(worn_overlays && worn_overlays.len) + if(worn_overlays?.len) standing.overlays.Add(worn_overlays) standing = center_image(standing, isinhands ? inhand_x_dimension : worn_x_dimension, isinhands ? inhand_y_dimension : worn_y_dimension) @@ -618,7 +618,7 @@ generate/load female uniform sprites matching all previously decided variables /mob/living/carbon/human/proc/update_observer_view(obj/item/I, inventory) - if(observers && observers.len) + if(observers?.len) for(var/M in observers) var/mob/dead/observe = M if(observe.client && observe.client.eye == src) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 33b521153b0..a02c66511ee 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1298,7 +1298,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) "You block [user]'s grab!", "You hear a swoosh!", COMBAT_MESSAGE_RANGE, user) to_chat(user, "Your grab at [target] was blocked!") return FALSE - if(attacker_style && attacker_style.grab_act(user,target)) + if(attacker_style?.grab_act(user,target)) return TRUE else //Steal them shoes @@ -1326,7 +1326,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) "You block [user]'s attack!", "You hear a swoosh!", COMBAT_MESSAGE_RANGE, user) to_chat(user, "Your attack at [target] was blocked!") return FALSE - if(attacker_style && attacker_style.harm_act(user,target)) + if(attacker_style?.harm_act(user,target)) return TRUE else diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index 51ee2295876..f43b33b8e46 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -39,7 +39,7 @@ // cultural contamination if(prob(human_surname_chance)) golem_surname = pick(GLOB.last_names) - else if(special_names && special_names.len && prob(special_name_chance)) + else if(special_names?.len && prob(special_name_chance)) golem_surname = pick(special_names) var/golem_name = "[prefix] [golem_surname]" diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 5e9eb5299ab..57f226fe104 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -494,7 +494,7 @@ /datum/action/innate/integrate_extract/ApplyIcon(obj/screen/movable/action_button/current_button, force) ..(current_button, TRUE) - if(species && species.current_extract) + if(species?.current_extract) current_button.add_overlay(mutable_appearance(species.current_extract.icon, species.current_extract.icon_state)) /datum/action/innate/integrate_extract/Activate() @@ -548,7 +548,7 @@ /datum/action/innate/use_extract/ApplyIcon(obj/screen/movable/action_button/current_button, force) ..(current_button, TRUE) - if(species && species.current_extract) + if(species?.current_extract) current_button.add_overlay(mutable_appearance(species.current_extract.icon, species.current_extract.icon_state)) /datum/action/innate/use_extract/Activate() diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm index 3b989e72057..be241a912cc 100644 --- a/code/modules/mob/living/carbon/inventory.dm +++ b/code/modules/mob/living/carbon/inventory.dm @@ -39,7 +39,7 @@ I.screen_loc = null if(client) client.screen -= I - if(observers && observers.len) + if(observers?.len) for(var/M in observers) var/mob/dead/observe = M if(observe.client) @@ -126,7 +126,7 @@ update_inv_neck(I) else if(I == handcuffed) set_handcuffed(null) - if(buckled && buckled.buckle_requires_restraints) + if(buckled?.buckle_requires_restraints) buckled.unbuckle_mob(src) if(!QDELETED(src)) update_handcuffed() diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 29548f212b0..6aee1167dca 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -370,7 +370,7 @@ //todo generalize this and move hud out /mob/living/carbon/proc/handle_changeling() - if(mind && hud_used && hud_used.lingchemdisplay) + if(mind && hud_used?.lingchemdisplay) var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) if(changeling) changeling.regenerate() @@ -381,7 +381,7 @@ /mob/living/carbon/handle_mutations_and_radiation() - if(dna && dna.temporary_mutations.len) + if(dna?.temporary_mutations.len) for(var/mut in dna.temporary_mutations) if(dna.temporary_mutations[mut] < world.time) if(mut == UI_CHANGED) @@ -405,7 +405,7 @@ dna.temporary_mutations.Remove(mut) continue for(var/datum/mutation/human/HM in dna.mutations) - if(HM && HM.timed) + if(HM?.timed) dna.remove_mutation(HM.type) radiation -= min(radiation, RAD_LOSS_PER_TICK) diff --git a/code/modules/mob/living/carbon/monkey/monkey_update_icons.dm b/code/modules/mob/living/carbon/monkey/monkey_update_icons.dm index fcba65d972f..400948b3ece 100644 --- a/code/modules/mob/living/carbon/monkey/monkey_update_icons.dm +++ b/code/modules/mob/living/carbon/monkey/monkey_update_icons.dm @@ -54,24 +54,24 @@ //update whether our head item appears on our hud. /mob/living/carbon/monkey/update_hud_head(obj/item/I) - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) I.screen_loc = ui_monkey_head client.screen += I //update whether our mask item appears on our hud. /mob/living/carbon/monkey/update_hud_wear_mask(obj/item/I) - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) I.screen_loc = ui_monkey_mask client.screen += I //update whether our neck item appears on our hud. /mob/living/carbon/monkey/update_hud_neck(obj/item/I) - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) I.screen_loc = ui_monkey_neck client.screen += I //update whether our back item appears on our hud. /mob/living/carbon/monkey/update_hud_back(obj/item/I) - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) I.screen_loc = ui_monkey_back client.screen += I diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 845a7ce4628..08df4afcfc4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -930,7 +930,7 @@ if(throwing) return var/fixed = 0 - if(anchored || (buckled && buckled.anchored)) + if(anchored || (buckled?.anchored)) fixed = 1 if(on && !(movement_type & FLOATING) && !fixed) animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1) @@ -1252,7 +1252,7 @@ C.Paralyze(40) /mob/living/can_be_pulled() - return ..() && !(buckled && buckled.buckle_prevents_pull) + return ..() && !(buckled?.buckle_prevents_pull) /// Called when mob changes from a standing position into a prone while lacking the ability to stand up at the moment. @@ -1284,7 +1284,7 @@ if(changeling.changeling_speak) return LINGHIVE_LING return LINGHIVE_OUTSIDER - if(mind && mind.linglink) + if(mind?.linglink) return LINGHIVE_LINK return LINGHIVE_NONE @@ -1389,7 +1389,7 @@ /mob/living/update_mouse_pointer() ..() - if (client && ranged_ability && ranged_ability.ranged_mousepointer) + if (client && ranged_ability?.ranged_mousepointer) client.mouse_pointer_icon = ranged_ability.ranged_mousepointer /mob/living/vv_edit_var(var_name, var_value) diff --git a/code/modules/mob/living/living_say.dm b/code/modules/mob/living/living_say.dm index 6952e79285a..466021a56cd 100644 --- a/code/modules/mob/living/living_say.dm +++ b/code/modules/mob/living/living_say.dm @@ -390,7 +390,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( return ITALICS | REDUCE_RANGE //SKYRAT EDIT END var/obj/item/implant/radio/imp = locate() in src - if(imp && imp.radio.on) + if(imp?.radio.on) if(message_mods[MODE_HEADSET]) imp.radio.talk_into(src, message, , spans, language, message_mods) return ITALICS | REDUCE_RANGE diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 7f399c67eb1..bd85233d166 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -520,9 +520,9 @@ C = O L[A.name] = list(A, (C) ? C : O, list(alarmsource)) if (O) - if (C && C.can_use()) + if (C?.can_use()) queueAlarm("--- [class] alarm detected in [A.name]! ([C.c_tag])", class) - else if (CL && CL.len) + else if (CL?.len) var/foo = 0 var/dat2 = "" for (var/obj/machinery/camera/I in CL) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 1996b816b14..028b574353c 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -8,7 +8,7 @@ handle_status_effects() - if(malfhack && malfhack.aidisabled) + if(malfhack?.aidisabled) deltimer(malfhacking) // This proc handles cleanup of screen notifications and // messenging the client @@ -94,7 +94,7 @@ sleep(50) var/turf/T = get_turf(src) var/area/AIarea = get_area(src) - if(AIarea && AIarea.power_equip) + if(AIarea?.power_equip) if(!isspaceturf(T)) ai_restore_power() return diff --git a/code/modules/mob/living/silicon/ai/multicam.dm b/code/modules/mob/living/silicon/ai/multicam.dm index a444b6e0f13..a848b64b4d5 100644 --- a/code/modules/mob/living/silicon/ai/multicam.dm +++ b/code/modules/mob/living/silicon/ai/multicam.dm @@ -127,7 +127,7 @@ GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room) ai_detector_color = COLOR_ORANGE /mob/camera/ai_eye/pic_in_pic/GetViewerClient() - if(screen && screen.ai) + if(screen?.ai) return screen.ai.client /mob/camera/ai_eye/pic_in_pic/setLoc(turf/T) @@ -135,7 +135,7 @@ GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room) forceMove(T) else moveToNullspace() - if(screen && screen.ai) + if(screen?.ai) screen.ai.camera_visibility(src) else GLOB.cameranet.visibility(src) diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index 3740192c9ff..4baaf21a6de 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -245,7 +245,7 @@ * * add - whether or not the item is being added, or removed. */ /mob/living/silicon/robot/proc/observer_screen_update(obj/item/item_module, add = TRUE) - if(observers && observers.len) + if(observers?.len) for(var/M in observers) var/mob/dead/observe = M if(observe.client && observe.client.eye == src) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 48fdc82d8d6..57570e60975 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -9,13 +9,13 @@ /mob/living/silicon/robot/proc/handle_robot_cell() if(stat != DEAD) if(low_power_mode) - if(cell && cell.charge) + if(cell?.charge) low_power_mode = FALSE else if(stat == CONSCIOUS) use_power() /mob/living/silicon/robot/proc/use_power() - if(cell && cell.charge) + if(cell?.charge) if(cell.charge <= 100) uneq_all() var/amt = clamp((lamp_enabled * lamp_intensity),1,cell.charge) //Lamp will use a max of 5 charge, depending on brightness of lamp. If lamp is off, borg systems consume 1 point of charge, or the rest of the cell if it's lower than that. diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index b22b7f90a09..bd100707711 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1077,7 +1077,7 @@ return FALSE /mob/living/silicon/robot/proc/picturesync() - if(connected_ai && connected_ai.aicamera && aicamera) + if(connected_ai?.aicamera && aicamera) for(var/i in aicamera.stored) connected_ai.aicamera.stored[i] = TRUE for(var/i in connected_ai.aicamera.stored) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 65c9ad56b77..35b1089a966 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -88,7 +88,7 @@ var/obj/item/stack/S = I if(is_type_in_list(S, list(/obj/item/stack/sheet/metal, /obj/item/stack/rods, /obj/item/stack/tile/plasteel))) - if(S.custom_materials && custom_materials.len) + if(S.custom_materials?.len) if(S.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)]) S.cost = S.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)] * 0.25 S.source = get_or_create_estorage(/datum/robot_energy_storage/metal) @@ -118,7 +118,7 @@ S.cost = 1 S.source = get_or_create_estorage(/datum/robot_energy_storage/pipe_cleaner) - if(S && S.source) + if(S?.source) S.set_custom_materials(null) S.is_cyborg = 1 diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index b439c4b9a58..880d4b6e946 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -566,7 +566,7 @@ Pass a positive integer as an argument to override a bot's default speed. calling_ai = caller //Link the AI to the bot! ai_waypoint = waypoint - if(path && path.len) //Ensures that a valid path is calculated! + if(path?.len) //Ensures that a valid path is calculated! var/end_area = get_area_name(waypoint) if(!on) turn_on() //Saves the AI the hassle of having to activate a bot manually. diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index 7101a2f1920..4c5fb5bf2f7 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -514,7 +514,7 @@ /mob/living/simple_animal/bot/mulebot/call_bot() ..() - if(path && path.len) + if(path?.len) target = ai_waypoint //Target is the end point of the path, the waypoint set by the AI. destination = get_area_name(target, TRUE) pathset = 1 //Indicates the AI's custom path is initialized. @@ -700,7 +700,7 @@ break else // otherwise, look for crates only AM = locate(/obj/structure/closet/crate) in get_step(loc,loaddir) - if(AM && AM.Adjacent(src)) + if(AM?.Adjacent(src)) load(AM) if(report_delivery) speak("Now loading [load] at [get_area_name(src)].", radio_channel) diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index 585c6d2e759..34fbaf6e0dd 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -399,11 +399,11 @@ desc = initial(desc) set_light(0) - if(inventory_head && inventory_head.dog_fashion) + if(inventory_head?.dog_fashion) var/datum/dog_fashion/DF = new inventory_head.dog_fashion(src) DF.apply(src) - if(inventory_back && inventory_back.dog_fashion) + if(inventory_back?.dog_fashion) var/datum/dog_fashion/DF = new inventory_back.dog_fashion(src) DF.apply(src) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm index a9045a5accd..2a84f9eb643 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm @@ -60,7 +60,7 @@ /mob/living/simple_animal/drone/proc/update_inv_internal_storage() - if(internal_storage && client && hud_used && hud_used.hud_shown) + if(internal_storage && client && hud_used?.hud_shown) internal_storage.screen_loc = ui_drone_storage client.screen += internal_storage @@ -69,7 +69,7 @@ remove_overlay(DRONE_HEAD_LAYER) if(head) - if(client && hud_used && hud_used.hud_shown) + if(client && hud_used?.hud_shown) head.screen_loc = ui_drone_head client.screen += head var/used_head_icon = 'icons/mob/clothing/head.dmi' diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index 7f17ff9f032..8f745afb80f 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -244,7 +244,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians summoner.dust() /mob/living/simple_animal/hostile/guardian/update_health_hud() - if(summoner && hud_used && hud_used.healths) + if(summoner && hud_used?.healths) var/resulthealth if(iscarbon(summoner)) resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - summoner.health) / abs(HEALTH_THRESHOLD_DEAD - summoner.maxHealth)) * 100) diff --git a/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm b/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm index d07fb00c619..680b81d269b 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm @@ -76,7 +76,7 @@ return ITEM_SLOT_DEX_STORAGE /mob/living/simple_animal/hostile/guardian/dextrous/proc/update_inv_internal_storage() - if(internal_storage && client && hud_used && hud_used.hud_shown) + if(internal_storage && client && hud_used?.hud_shown) internal_storage.screen_loc = ui_id client.screen += internal_storage diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index fbdd89034fa..278c24a8830 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -119,7 +119,7 @@ cut_overlays() var/col = BEE_DEFAULT_COLOUR - if(beegent && beegent.color) + if(beegent?.color) col = beegent.color add_overlay("[icon_base]_base") @@ -301,7 +301,7 @@ S.reagents.remove_reagent(/datum/reagent/royal_bee_jelly, 5) var/obj/item/queen_bee/qb = new(user.drop_location()) qb.queen = new(qb) - if(queen && queen.beegent) + if(queen?.beegent) qb.queen.assign_reagent(queen.beegent) //Bees use the global singleton instances of reagents, so we don't need to worry about one bee being deleted and her copies losing their reagents. user.put_in_active_hand(qb) user.visible_message("[user] injects [src] with royal bee jelly, causing it to split into two bees, MORE BEES!","You inject [src] with royal bee jelly, causing it to split into two bees, MORE BEES!") diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index d6d819edb2d..90d3a3ca2a0 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -678,7 +678,7 @@ Difficulty: Hard return for(var/mob/living/L in T.contents - hit_things) //find and damage mobs... hit_things += L - if((friendly_fire_check && caster && caster.faction_check_mob(L)) || L.stat == DEAD) + if((friendly_fire_check && caster?.faction_check_mob(L)) || L.stat == DEAD) continue if(L.client) flash_color(L.client, "#660099", 1) @@ -703,7 +703,7 @@ Difficulty: Hard hit_things += M for(var/O in M.occupants) var/mob/living/occupant = O - if(friendly_fire_check && caster && caster.faction_check_mob(occupant)) + if(friendly_fire_check && caster?.faction_check_mob(occupant)) continue to_chat(occupant, "Your [M.name] is struck by a [name]!") playsound(M,'sound/weapons/sear.ogg', 50, TRUE, -4) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm index 85e3da04cbd..81a757a4f96 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm @@ -184,10 +184,10 @@ /obj/item/clothing/accessory/pandora_hope/on_uniform_equip(obj/item/clothing/under/U, user) var/mob/living/L = user - if(L && L.mind) + if(L?.mind) SEND_SIGNAL(L, COMSIG_ADD_MOOD_EVENT, "hope_lavaland", /datum/mood_event/hope_lavaland) /obj/item/clothing/accessory/pandora_hope/on_uniform_dropped(obj/item/clothing/under/U, user) var/mob/living/L = user - if(L && L.mind) + if(L?.mind) SEND_SIGNAL(L, COMSIG_CLEAR_MOOD_EVENT, "hope_lavaland") diff --git a/code/modules/mob/living/simple_animal/hostile/netherworld.dm b/code/modules/mob/living/simple_animal/hostile/netherworld.dm index a2a4ad00ccd..62a2dfac9b1 100644 --- a/code/modules/mob/living/simple_animal/hostile/netherworld.dm +++ b/code/modules/mob/living/simple_animal/hostile/netherworld.dm @@ -87,7 +87,7 @@ /mob/living/simple_animal/hostile/netherworld/proc/can_be_seen(turf/location) // Check for darkness - if(location && location.lighting_object) + if(location?.lighting_object) if(location.get_lumcount()<0.1) // No one can see us in the darkness, right? return null diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index c250b8700a3..52d9fff9e83 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -289,7 +289,7 @@ playsound(src, 'sound/effects/sparks2.ogg', 100, TRUE) C.deconstruct() death() - else if(C && C.avail()) + else if(C?.avail()) visible_message("[src] chews through the [C]. It looks unharmed!") playsound(src, 'sound/effects/sparks2.ogg', 100, TRUE) C.deconstruct() diff --git a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm index 68a9d11baac..67c966383a2 100644 --- a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm +++ b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm @@ -100,7 +100,7 @@ if(!chosen_color) dragon_name() color_selection() - + /mob/living/simple_animal/hostile/space_dragon/Life(mapload) . = ..() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 0b1d96dd814..276a18fb293 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -266,12 +266,12 @@ set waitfor = FALSE if(speak_chance) if(prob(speak_chance) || override) - if(speak && speak.len) - if((emote_hear && emote_hear.len) || (emote_see && emote_see.len)) + if(speak?.len) + if((emote_hear?.len) || (emote_see?.len)) var/length = speak.len - if(emote_hear && emote_hear.len) + if(emote_hear?.len) length += emote_hear.len - if(emote_see && emote_see.len) + if(emote_see?.len) length += emote_see.len var/randomValue = rand(1,length) if(randomValue <= speak.len) @@ -285,11 +285,11 @@ else say(pick(speak), forced = "poly") else - if(!(emote_hear && emote_hear.len) && (emote_see && emote_see.len)) + if(!(emote_hear?.len) && (emote_see?.len)) manual_emote(pick(emote_see)) - if((emote_hear && emote_hear.len) && !(emote_see && emote_see.len)) + if((emote_hear?.len) && !(emote_see?.len)) manual_emote(pick(emote_hear)) - if((emote_hear && emote_hear.len) && (emote_see && emote_see.len)) + if((emote_hear?.len) && (emote_see?.len)) var/length = emote_hear.len + emote_see.len var/pick = rand(1,length) if(pick <= emote_see.len) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 815d1688a58..b684b65601f 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -32,7 +32,7 @@ progressbars = null for (var/alert in alerts) clear_alert(alert, TRUE) - if(observers && observers.len) + if(observers?.len) for(var/M in observers) var/mob/dead/observe = M observe.reset_perspective(null) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 13f7dbd536f..0f8021d2733 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -283,7 +283,7 @@ a_intent = possible_a_intents[current_intent] - if(hud_used && hud_used.action_intent) + if(hud_used?.action_intent) hud_used.action_intent.icon_state = "[a_intent]" ///Checks if the mob is able to see or not. eye_blind is temporary blindness, the trait is if they're permanently blind. diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 48ae341b280..d578ec96b71 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -18,7 +18,7 @@ * Has no sanity other than checking density */ /client/proc/Move_object(direct) - if(mob && mob.control_object) + if(mob?.control_object) if(mob.control_object.density) step(mob.control_object,direct) if(!mob.control_object) @@ -464,7 +464,7 @@ return FALSE //SKYRAT EDIT ADDITION END m_intent = MOVE_INTENT_RUN - if(hud_used && hud_used.static_inventory) + if(hud_used?.static_inventory) for(var/obj/screen/mov_intent/selector in hud_used.static_inventory) selector.update_icon() diff --git a/code/modules/mob/mob_say.dm b/code/modules/mob/mob_say.dm index db7238c2207..4d9b195b129 100644 --- a/code/modules/mob/mob_say.dm +++ b/code/modules/mob/mob_say.dm @@ -75,7 +75,7 @@ if(isobserver(src) && O.deadchat_name) name = "[O.deadchat_name]" else - if(mind && mind.name) + if(mind?.name) name = "[mind.name]" else name = real_name diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 2f4db366c67..0ae6b10c7b1 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -121,7 +121,7 @@ for(var/X in O.internal_organs) var/obj/item/organ/G = X if(BP.body_zone == check_zone(G.zone)) - if(mind && mind.has_antag_datum(/datum/antagonist/changeling) && istype(G, /obj/item/organ/brain)) + if(mind?.has_antag_datum(/datum/antagonist/changeling) && istype(G, /obj/item/organ/brain)) continue //so headless changelings don't lose their brain when transforming qdel(G) //we lose the organs in the missing limbs qdel(BP) @@ -298,7 +298,7 @@ for(var/X in O.internal_organs) var/obj/item/organ/G = X if(BP.body_zone == check_zone(G.zone)) - if(mind && mind.has_antag_datum(/datum/antagonist/changeling) && istype(G, /obj/item/organ/brain)) + if(mind?.has_antag_datum(/datum/antagonist/changeling) && istype(G, /obj/item/organ/brain)) continue //so headless changelings don't lose their brain when transforming qdel(G) //we lose the organs in the missing limbs qdel(BP) diff --git a/code/modules/modular_computers/computers/item/computer_power.dm b/code/modules/modular_computers/computers/item/computer_power.dm index 7eb7998fc1b..92d4a812a27 100644 --- a/code/modules/modular_computers/computers/item/computer_power.dm +++ b/code/modules/modular_computers/computers/item/computer_power.dm @@ -5,7 +5,7 @@ var/obj/item/computer_hardware/recharger/recharger = all_components[MC_CHARGE] - if(recharger && recharger.check_functionality()) + if(recharger?.check_functionality()) if(recharger.use_power(amount)) return TRUE @@ -22,7 +22,7 @@ /obj/item/modular_computer/proc/give_power(amount) var/obj/item/computer_hardware/battery/battery_module = all_components[MC_CELL] - if(battery_module && battery_module.battery) + if(battery_module?.battery) return battery_module.battery.give(amount) return 0 diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm index 8c415323bb8..289ae7155fd 100644 --- a/code/modules/modular_computers/computers/machinery/modular_computer.dm +++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm @@ -58,7 +58,7 @@ icon_state = icon_state_powered if(!cpu || !cpu.enabled) - if (!(machine_stat & NOPOWER) && (cpu && cpu.use_power())) + if (!(machine_stat & NOPOWER) && (cpu?.use_power())) add_overlay(screen_icon_screensaver) else icon_state = icon_state_unpowered @@ -96,7 +96,7 @@ // Used in following function to reduce copypaste /obj/machinery/modular_computer/proc/power_failure(malfunction = 0) var/obj/item/computer_hardware/battery/battery_module = cpu.all_components[MC_CELL] - if(cpu && cpu.enabled) // Shut down the computer + if(cpu?.enabled) // Shut down the computer visible_message("\The [src]'s screen flickers [battery_module ? "\"BATTERY [malfunction ? "MALFUNCTION" : "CRITICAL"]\"" : "\"EXTERNAL POWER LOSS\""] warning as it shuts down unexpectedly.") if(cpu) cpu.shutdown_computer(0) @@ -105,7 +105,7 @@ // Modular computers can have battery in them, we handle power in previous proc, so prevent this from messing it up for us. /obj/machinery/modular_computer/power_change() - if(cpu && cpu.use_power()) // If MC_CPU still has a power source, PC wouldn't go offline. + if(cpu?.use_power()) // If MC_CPU still has a power source, PC wouldn't go offline. set_machine_stat(machine_stat & ~NOPOWER) update_icon() return diff --git a/code/modules/modular_computers/file_system/programs/airestorer.dm b/code/modules/modular_computers/file_system/programs/airestorer.dm index 2bcb92d006f..8e3bbb20f56 100644 --- a/code/modules/modular_computers/file_system/programs/airestorer.dm +++ b/code/modules/modular_computers/file_system/programs/airestorer.dm @@ -20,7 +20,7 @@ if(computer) ai_slot = computer.all_components[MC_AI] - if(computer && ai_slot && ai_slot.check_functionality()) + if(computer && ai_slot?.check_functionality()) if(cardcheck == 1) return ai_slot if(ai_slot.enabled && ai_slot.stored_card) @@ -49,7 +49,7 @@ if("PRG_eject") if(computer.all_components[MC_AI]) var/obj/item/computer_hardware/ai_slot/ai_slot = computer.all_components[MC_AI] - if(ai_slot && ai_slot.stored_card) + if(ai_slot?.stored_card) ai_slot.try_eject(usr) return TRUE diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index 46195a8f69b..10be48af7f1 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -132,7 +132,7 @@ if(!authenticated) return var/contents = {"

Access Report

- Prepared By: [user_id_card && user_id_card.registered_name ? user_id_card.registered_name : "Unknown"]
+ Prepared By: [user_id_card?.registered_name ? user_id_card.registered_name : "Unknown"]
For: [target_id_card.registered_name ? target_id_card.registered_name : "Unregistered"]

Assignment: [target_id_card.assignment]
diff --git a/code/modules/modular_computers/file_system/programs/cargoship.dm b/code/modules/modular_computers/file_system/programs/cargoship.dm index 8219d95ba2d..1e006b5c69e 100644 --- a/code/modules/modular_computers/file_system/programs/cargoship.dm +++ b/code/modules/modular_computers/file_system/programs/cargoship.dm @@ -20,7 +20,7 @@ data["has_id_slot"] = !!card_slot data["has_printer"] = !!printer data["paperamt"] = printer ? "[printer.stored_paper] / [printer.max_paper]" : null - data["card_owner"] = card_slot && card_slot.stored_card ? id_card.registered_name : "No Card Inserted." + data["card_owner"] = card_slot?.stored_card ? id_card.registered_name : "No Card Inserted." data["current_user"] = payments_acc ? payments_acc.account_holder : null data["barcode_split"] = percent_cut return data diff --git a/code/modules/modular_computers/file_system/programs/configurator.dm b/code/modules/modular_computers/file_system/programs/configurator.dm index 20418dad1d3..cf5d950c0f6 100644 --- a/code/modules/modular_computers/file_system/programs/configurator.dm +++ b/code/modules/modular_computers/file_system/programs/configurator.dm @@ -35,11 +35,11 @@ data["disk_used"] = hard_drive.used_capacity data["power_usage"] = movable.last_power_usage data["battery_exists"] = battery_module ? 1 : 0 - if(battery_module && battery_module.battery) + if(battery_module?.battery) data["battery_rating"] = battery_module.battery.maxcharge data["battery_percent"] = round(battery_module.battery.percent()) - if(battery_module && battery_module.battery) + if(battery_module?.battery) data["battery"] = list("max" = battery_module.battery.maxcharge, "charge" = round(battery_module.battery.charge)) var/list/all_entries[0] diff --git a/code/modules/modular_computers/file_system/programs/ntdownloader.dm b/code/modules/modular_computers/file_system/programs/ntdownloader.dm index 5bdae9ee46d..f3fa6df2b3a 100644 --- a/code/modules/modular_computers/file_system/programs/ntdownloader.dm +++ b/code/modules/modular_computers/file_system/programs/ntdownloader.dm @@ -185,7 +185,7 @@ /datum/computer_file/program/ntnetdownload/proc/check_compatibility(datum/computer_file/program/P) var/hardflag = computer.hardware_flag - if(P && P.is_supported_by_hardware(hardflag,0)) + if(P?.is_supported_by_hardware(hardflag,0)) return "Compatible" return "Incompatible!" diff --git a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm index b34c7e7dfb3..19172f130ab 100644 --- a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm +++ b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm @@ -184,7 +184,7 @@ var/list/all_channels = list() for(var/C in SSnetworks.station_network.chat_channels) var/datum/ntnet_conversation/conv = C - if(conv && conv.title) + if(conv?.title) all_channels.Add(list(list( "chan" = conv.title, "id" = conv.id diff --git a/code/modules/modular_computers/file_system/programs/powermonitor.dm b/code/modules/modular_computers/file_system/programs/powermonitor.dm index e0b097fc739..78a14ff1ad8 100644 --- a/code/modules/modular_computers/file_system/programs/powermonitor.dm +++ b/code/modules/modular_computers/file_system/programs/powermonitor.dm @@ -50,7 +50,7 @@ local_apc = null /datum/computer_file/program/power_monitor/proc/get_powernet() //keep in sync with /obj/machinery/computer/monitor's version - if(attached_wire || (local_apc && local_apc.terminal)) + if(attached_wire || (local_apc?.terminal)) return attached_wire ? attached_wire.powernet : local_apc.terminal.powernet return FALSE diff --git a/code/modules/modular_computers/file_system/programs/radar.dm b/code/modules/modular_computers/file_system/programs/radar.dm index 0d68c3f729a..7f688b7efd3 100644 --- a/code/modules/modular_computers/file_system/programs/radar.dm +++ b/code/modules/modular_computers/file_system/programs/radar.dm @@ -230,7 +230,7 @@ var/crewmember_name = "Unknown" if(humanoid.wear_id) var/obj/item/card/id/ID = humanoid.wear_id.GetID() - if(ID && ID.registered_name) + if(ID?.registered_name) crewmember_name = ID.registered_name var/list/crewinfo = list( ref = REF(humanoid), diff --git a/code/modules/ninja/suit/ninjaDrainAct.dm b/code/modules/ninja/suit/ninjaDrainAct.dm index 189f70a71c9..02dceb3b40f 100644 --- a/code/modules/ninja/suit/ninjaDrainAct.dm +++ b/code/modules/ninja/suit/ninjaDrainAct.dm @@ -27,7 +27,7 @@ They *could* go in their appropriate files, but this is supposed to be modular . = 0 - if(cell && cell.charge) + if(cell?.charge) var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread() spark_system.set_up(5, 0, loc) @@ -227,7 +227,7 @@ They *could* go in their appropriate files, but this is supposed to be modular to_chat(src, "Warning: Unauthorized access through sub-route 12, block C, detected.") - if(cell && cell.charge) + if(cell?.charge) while(G.candrain && cell.charge > 0 && !maxcapacity) drain = rand(G.mindrain,G.maxdrain) if(cell.charge < drain) diff --git a/code/modules/ninja/suit/suit_attackby.dm b/code/modules/ninja/suit/suit_attackby.dm index fa20f9e50ef..fbad289fc32 100644 --- a/code/modules/ninja/suit/suit_attackby.dm +++ b/code/modules/ninja/suit/suit_attackby.dm @@ -19,9 +19,9 @@ else if(istype(I, /obj/item/stock_parts/cell)) var/obj/item/stock_parts/cell/CELL = I - if(CELL.maxcharge > cell.maxcharge && n_gloves && n_gloves.candrain) + if(CELL.maxcharge > cell.maxcharge && n_gloves?.candrain) to_chat(U, "Higher maximum capacity detected.\nUpgrading...") - if (n_gloves && n_gloves.candrain && do_after(U,s_delay, target = src)) + if (n_gloves?.candrain && do_after(U,s_delay, target = src)) U.transferItemToLoc(CELL, src) CELL.charge = min(CELL.charge+cell.charge, CELL.maxcharge) var/obj/item/stock_parts/cell/old_cell = cell diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 7226db4b1fc..ed89d9ec488 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1168,7 +1168,7 @@ return 0 /obj/machinery/power/apc/add_load(amount) - if(terminal && terminal.powernet) + if(terminal?.powernet) terminal.add_load(amount) /obj/machinery/power/apc/avail(amount) diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 8efd5a68773..20417cd443c 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -85,7 +85,7 @@ update_icon() - var/circ = "[cold_circ && cold_circ.last_pressure_delta > 0 ? "1" : "0"][hot_circ && hot_circ.last_pressure_delta > 0 ? "1" : "0"]" + var/circ = "[cold_circ?.last_pressure_delta > 0 ? "1" : "0"][hot_circ?.last_pressure_delta > 0 ? "1" : "0"]" if(circ != lastcirc) lastcirc = circ update_icon() diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 0e99b84efda..fda245e868b 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -339,7 +339,7 @@ switch(status) // set icon_states if(LIGHT_OK) var/area/A = get_area(src) - if(emergency_mode || (A && A.fire)) + if(emergency_mode || (A?.fire)) icon_state = "[base_state]_emergency" else icon_state = "[base_state]" @@ -370,7 +370,7 @@ if(color) CO = color var/area/A = get_area(src) - if (A && A.fire) + if (A?.fire) CO = bulb_emergency_colour else if (nightshift_enabled) BR = nightshift_brightness diff --git a/code/modules/power/monitor.dm b/code/modules/power/monitor.dm index 393d403c4df..2f7793d029a 100644 --- a/code/modules/power/monitor.dm +++ b/code/modules/power/monitor.dm @@ -60,7 +60,7 @@ local_apc = null /obj/machinery/computer/monitor/proc/get_powernet() //keep in sync with /datum/computer_file/program/power_monitor's version - if(attached_wire || (local_apc && local_apc.terminal)) + if(attached_wire || (local_apc?.terminal)) return attached_wire ? attached_wire.powernet : local_apc.terminal.powernet return FALSE diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm index 1a6a725e4e7..e29e186d403 100644 --- a/code/modules/power/powernet.dm +++ b/code/modules/power/powernet.dm @@ -80,7 +80,7 @@ //see if there's a surplus of power remaining in the powernet and stores unused power in the SMES netexcess = avail - load - if(netexcess > 100 && nodes && nodes.len) // if there was excess power last cycle + if(netexcess > 100 && nodes?.len) // if there was excess power last cycle for(var/obj/machinery/power/smes/S in nodes) // find the SMESes in the network S.restore() // and restore some of the power that was used diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 0fa0c772dd3..030e9ba0c4b 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -399,11 +399,11 @@ return FALSE else if(locate(/obj/machinery/field/generator) in T) var/obj/machinery/field/generator/G = locate(/obj/machinery/field/generator) in T - if(G && G.active) + if(G?.active) return FALSE else if(locate(/obj/machinery/power/shieldwallgen) in T) var/obj/machinery/power/shieldwallgen/S = locate(/obj/machinery/power/shieldwallgen) in T - if(S && S.active) + if(S?.active) return FALSE return TRUE diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 393320aceb1..1b768509ce0 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -1209,7 +1209,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) //This gotdamn variable is a boomer and keeps giving me problems var/turf/T = get_turf(target) var/pressure = 1 - if(T && T.return_air()) + if(T?.return_air()) pressure = max(1,T.return_air().return_pressure()) //We get our range with the strength of the zap and the pressure, the higher the former and the lower the latter the better var/new_range = clamp(zap_str / pressure * 10, 2, 7) diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index e9aaceca01a..eda1d4ebd26 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -272,7 +272,7 @@ switch(action) if("toggle_power") - if(compressor && compressor.turbine) + if(compressor?.turbine) compressor.starter = !compressor.starter . = TRUE if("reconnect") @@ -334,7 +334,7 @@ switch(action) if("toggle_power") - if(compressor && compressor.turbine) + if(compressor?.turbine) compressor.starter = !compressor.starter . = TRUE if("reconnect") diff --git a/code/modules/projectiles/ammunition/_ammunition.dm b/code/modules/projectiles/ammunition/_ammunition.dm index 2656cc0355c..9598ffe2251 100644 --- a/code/modules/projectiles/ammunition/_ammunition.dm +++ b/code/modules/projectiles/ammunition/_ammunition.dm @@ -102,7 +102,7 @@ update_icon() SpinAnimation(10, 1) var/turf/T = get_turf(src) - if(still_warm && T && T.bullet_sizzle) + if(still_warm && T?.bullet_sizzle) addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, src, 'sound/items/welder.ogg', 20, 1), bounce_delay) //If the turf is made of water and the shell casing is still hot, make a sizzling sound when it's ejected. - else if(T && T.bullet_bounce_sound) + else if(T?.bullet_bounce_sound) addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, src, T.bullet_bounce_sound, 20, 1), bounce_delay) //Soft / non-solid turfs that shouldn't make a sound when a shell casing is ejected over them. diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 9757477f9ff..861b1bd449a 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -288,7 +288,7 @@ if(iteration > 1 && !(user.is_holding(src))) //for burst firing firing_burst = FALSE return FALSE - if(chambered && chambered.BB) + if(chambered?.BB) if(HAS_TRAIT(user, TRAIT_PACIFISM)) // If the user has the pacifist trait, then they won't be able to fire [src] if the round chambered inside of [src] is lethal. if(chambered.harmful) // Is the bullet chambered harmful? to_chat(user, "[src] is lethally chambered! You don't want to risk harming anyone...") @@ -620,7 +620,7 @@ if(user) if(user == target) user.visible_message("[user] decided not to shoot.") - else if(target && target.Adjacent(user)) + else if(target?.Adjacent(user)) target.visible_message("[user] has decided to spare [target]", "[user] has decided to spare your life!") semicd = FALSE return @@ -629,7 +629,7 @@ target.visible_message("[user] pulls the trigger!", "[(user == target) ? "You pull" : "[user] pulls"] the trigger!") - if(chambered && chambered.BB) + if(chambered?.BB) chambered.BB.damage *= 5 if(chambered.BB.wound_bonus != CANT_WOUND) chambered.BB.wound_bonus += 5 // much more dramatic on multiple pellet'd projectiles really diff --git a/code/modules/projectiles/guns/ballistic/rifle.dm b/code/modules/projectiles/guns/ballistic/rifle.dm index eb707654b9d..e6f61be9a48 100644 --- a/code/modules/projectiles/guns/ballistic/rifle.dm +++ b/code/modules/projectiles/guns/ballistic/rifle.dm @@ -73,7 +73,7 @@ /obj/item/gun/ballistic/rifle/boltaction/blow_up(mob/user) . = 0 - if(chambered && chambered.BB) + if(chambered?.BB) process_fire(user, user, FALSE) . = 1 diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index 4f77d37f687..00391820392 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -30,7 +30,7 @@ /obj/item/gun/ballistic/shotgun/blow_up(mob/user) . = 0 - if(chambered && chambered.BB) + if(chambered?.BB) process_fire(user, user, FALSE) . = 1 diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 8c844b6ef0a..732a9ab0130 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -249,7 +249,7 @@ L.on_hit(src) var/reagent_note - if(reagents && reagents.reagent_list) + if(reagents?.reagent_list) reagent_note = " REAGENTS:" for(var/datum/reagent/R in reagents.reagent_list) reagent_note += "[R.name] ([num2text(R.volume)])" diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 5dd1a6d962c..4c573c30558 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -366,13 +366,13 @@ var/list/datum/reagents/R = list() var/total = min(rand(7,15), FLOOR(cell.charge*powerefficiency, 1)) var/datum/reagents/Q = new(total*10) - if(beaker && beaker.reagents) + if(beaker?.reagents) R += beaker.reagents for(var/i in 1 to total) Q.add_reagent(pick(dispensable_reagents), 10) R += Q chem_splash(get_turf(src), 3, R) - if(beaker && beaker.reagents) + if(beaker?.reagents) beaker.reagents.remove_all() cell.use(total/powerefficiency) cell.emp_act(severity) diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 5ba9346e41f..17d3a56fed7 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -61,7 +61,7 @@ if(machine_stat & NOPOWER) return if(on) - if(beaker && beaker.reagents.total_volume) + if(beaker?.reagents.total_volume) //keep constant with the chemical acclimator please beaker.reagents.adjust_thermal_energy((target_temperature - beaker.reagents.chem_temp) * heater_coefficient * delta_time * SPECIFIC_HEAT_DEFAULT * beaker.reagents.total_volume) beaker.reagents.handle_reactions() diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index 83504e9232a..8d93a052123 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -50,7 +50,7 @@ if(!beaker || !beaker.reagents) return var/datum/reagent/blood/B = locate() in beaker.reagents.reagent_list - if(B && B.data[thing]) + if(B?.data[thing]) return B.data[thing][index] /obj/machinery/computer/pandemic/proc/get_virus_id_by_index(index) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 47eb8958c89..ddd911ab6f2 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -793,7 +793,7 @@ return ..() /datum/reagent/toxin/rotatium/on_mob_end_metabolize(mob/living/M) - if(M && M.hud_used) + if(M?.hud_used) var/list/screens = list(M.hud_used.plane_masters["[FLOOR_PLANE]"], M.hud_used.plane_masters["[GAME_PLANE]"], M.hud_used.plane_masters["[LIGHTING_PLANE]"]) for(var/whole_screen in screens) animate(whole_screen, transform = matrix(), time = 5, easing = QUAD_EASING) diff --git a/code/modules/reagents/chemistry/recipes.dm b/code/modules/reagents/chemistry/recipes.dm index dd7eeed7e55..78e1e818909 100644 --- a/code/modules/reagents/chemistry/recipes.dm +++ b/code/modules/reagents/chemistry/recipes.dm @@ -70,7 +70,7 @@ * * random - creates random mobs. self explanatory. */ /datum/chemical_reaction/proc/chemical_mob_spawn(datum/reagents/holder, amount_to_spawn, reaction_name, mob_class = HOSTILE_SPAWN, mob_faction = "chemicalsummon", random = TRUE) - if(holder && holder.my_atom) + if(holder?.my_atom) var/atom/A = holder.my_atom var/turf/T = get_turf(A) var/message = "Mobs have been spawned in [ADMIN_VERBOSEJMP(T)] by a [reaction_name] reaction." diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index 79eb862646f..c65e81b0a02 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -178,7 +178,7 @@ /datum/chemical_reaction/mix_virus/on_reaction(datum/reagents/holder, created_volume) var/datum/reagent/blood/B = locate(/datum/reagent/blood) in holder.reagent_list - if(B && B.data) + if(B?.data) var/datum/disease/advance/D = locate(/datum/disease/advance) in B.data["viruses"] if(D) D.Evolve(level_min, level_max) @@ -245,7 +245,7 @@ /datum/chemical_reaction/mix_virus/rem_virus/on_reaction(datum/reagents/holder, created_volume) var/datum/reagent/blood/B = locate(/datum/reagent/blood) in holder.reagent_list - if(B && B.data) + if(B?.data) var/datum/disease/advance/D = locate(/datum/disease/advance) in B.data["viruses"] if(D) D.Devolve() @@ -256,7 +256,7 @@ /datum/chemical_reaction/mix_virus/neuter_virus/on_reaction(datum/reagents/holder, created_volume) var/datum/reagent/blood/B = locate(/datum/reagent/blood) in holder.reagent_list - if(B && B.data) + if(B?.data) var/datum/disease/advance/D = locate(/datum/disease/advance) in B.data["viruses"] if(D) D.Neuter() diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index 22cdeee5096..8975934bcf9 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -339,7 +339,7 @@ if(S) S.set_up(holder, smoke_radius, location, 0) S.start() - if(holder && holder.my_atom) + if(holder?.my_atom) holder.clear_reagents() /datum/chemical_reaction/smoke_powder_smoke @@ -356,7 +356,7 @@ if(S) S.set_up(holder, smoke_radius, location, 0) S.start() - if(holder && holder.my_atom) + if(holder?.my_atom) holder.clear_reagents() /datum/chemical_reaction/sonic_powder diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm index 0deeb391c29..c98c048172a 100644 --- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm +++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm @@ -204,7 +204,7 @@ M.qdel_timer = addtimer(CALLBACK(src, .proc/delete_extract, holder), 55, TIMER_STOPPABLE) /datum/chemical_reaction/slime/slimefreeze/proc/freeze(datum/reagents/holder) - if(holder && holder.my_atom) + if(holder?.my_atom) var/turf/open/T = get_turf(holder.my_atom) if(istype(T)) var/datum/gas/gastype = /datum/gas/nitrogen @@ -242,7 +242,7 @@ M.qdel_timer = addtimer(CALLBACK(src, .proc/delete_extract, holder), 55, TIMER_STOPPABLE) /datum/chemical_reaction/slime/slimefire/proc/slime_burn(datum/reagents/holder) - if(holder && holder.my_atom) + if(holder?.my_atom) var/turf/open/T = get_turf(holder.my_atom) if(istype(T)) T.atmos_spawn_air("plasma=50;TEMP=1000") @@ -391,7 +391,7 @@ M.qdel_timer = addtimer(CALLBACK(src, .proc/delete_extract, holder), 55, TIMER_STOPPABLE) /datum/chemical_reaction/slime/slimeexplosion/proc/boom(datum/reagents/holder) - if(holder && holder.my_atom) + if(holder?.my_atom) explosion(get_turf(holder.my_atom), 1 ,3, 6) diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index 26c8e3fccb6..3ca6fef15ba 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -96,7 +96,7 @@ Borg Hypospray /obj/item/reagent_containers/borghypo/proc/regenerate_reagents() if(iscyborg(src.loc)) var/mob/living/silicon/robot/R = src.loc - if(R && R.cell) + if(R?.cell) for(var/i in 1 to reagent_ids.len) var/datum/reagents/RG = reagent_list[i] if(RG.total_volume < RG.maximum_volume) //Don't recharge reagents and drain power if the storage is full. @@ -225,7 +225,7 @@ Borg Shaker /obj/item/reagent_containers/borghypo/borgshaker/regenerate_reagents() if(iscyborg(src.loc)) var/mob/living/silicon/robot/R = src.loc - if(R && R.cell) + if(R?.cell) for(var/i in modes) //Lots of reagents in this one, so it's best to regenrate them all at once to keep it from being tedious. var/valueofi = modes[i] var/datum/reagents/RG = reagent_list[valueofi] diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 75dc47805cf..fd311a291b7 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -137,7 +137,7 @@ /obj/item/reagent_containers/hypospray/medipen/examine() . = ..() - if(reagents && reagents.reagent_list.len) + if(reagents?.reagent_list.len) . += "It is currently loaded." else . += "It is spent." diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 7485ed6ddb2..e027e73eaa2 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -175,7 +175,7 @@ /obj/item/reagent_containers/syringe/update_overlays() . = ..() var/rounded_vol = get_rounded_vol() - if(reagents && reagents.total_volume) + if(reagents?.total_volume) var/mutable_appearance/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]") filling_overlay.color = mix_color_from_reagents(reagents.reagent_list) . += filling_overlay @@ -190,7 +190,7 @@ ///Used by update_icon() and update_overlays() /obj/item/reagent_containers/syringe/proc/get_rounded_vol() - if(reagents && reagents.total_volume) + if(reagents?.total_volume) return clamp(round((reagents.total_volume / volume * 15),5), 1, 15) else return 0 diff --git a/code/modules/research/nanites/nanite_cloud_controller.dm b/code/modules/research/nanites/nanite_cloud_controller.dm index 67fa6d879dd..75697c97778 100644 --- a/code/modules/research/nanites/nanite_cloud_controller.dm +++ b/code/modules/research/nanites/nanite_cloud_controller.dm @@ -190,7 +190,7 @@ investigate_log("[key_name(usr)] deleted the nanite cloud backup #[current_view]", INVESTIGATE_NANITES) . = TRUE if("upload_program") - if(disk && disk.program) + if(disk?.program) var/datum/nanite_cloud_backup/backup = get_backup(current_view) if(backup) playsound(src, 'sound/machines/terminal_prompt.ogg', 50, FALSE) diff --git a/code/modules/research/nanites/nanite_program_hub.dm b/code/modules/research/nanites/nanite_program_hub.dm index 5bf234e896f..36534efd9a8 100644 --- a/code/modules/research/nanites/nanite_program_hub.dm +++ b/code/modules/research/nanites/nanite_program_hub.dm @@ -135,7 +135,7 @@ detail_view = !detail_view . = TRUE if("clear") - if(disk && disk.program) + if(disk?.program) qdel(disk.program) disk.program = null disk.name = initial(disk.name) diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index ed415f46e4a..261888d430a 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -146,7 +146,7 @@ owner.remove_status_effect(src) /datum/status_effect/slime_clone/on_remove() - if(clone && clone.mind && owner) + if(clone?.mind && owner) clone.mind.transfer_to(owner) else if(owner && originalmind) diff --git a/code/modules/ruins/spaceruin_code/TheDerelict.dm b/code/modules/ruins/spaceruin_code/TheDerelict.dm index 6594518d82e..527027c3e25 100644 --- a/code/modules/ruins/spaceruin_code/TheDerelict.dm +++ b/code/modules/ruins/spaceruin_code/TheDerelict.dm @@ -96,9 +96,9 @@ ///Attempts to unlock the vault doors /obj/machinery/computer/vaultcontroller/proc/unlock_vault() - if(door1 && door1.density) + if(door1?.density) cycle_open(door1) - if(door2 && door2.density) + if(door2?.density) cycle_open(door2) if(!door1.density && door1.locked && !door2.density && door2.locked) locked = FALSE diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 37ce3fc364c..f8386247382 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -186,7 +186,7 @@ for(var/obj/item/card/id/ID in src) qdel(ID) - if(authorized && authorized.len) + if(authorized?.len) authorized.Cut() authorized = null diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index e120da6f210..174b742f5bd 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -45,7 +45,7 @@ . = ..() GLOB.navigation_computers -= src - if(my_port && my_port.get_docked()) + if(my_port?.get_docked()) my_port.delete_after = TRUE my_port.id = null my_port.name = "Old [my_port.name]" @@ -154,7 +154,7 @@ return ///Make one use port that deleted after fly off, to don't lose info that need on to properly fly off. - if(my_port && my_port.get_docked()) + if(my_port?.get_docked()) my_port.unregister() my_port.delete_after = TRUE my_port.id = null @@ -279,7 +279,7 @@ return SHUTTLE_DOCKER_BLOCKED /obj/machinery/computer/camera_advanced/shuttle_docker/proc/update_hidden_docking_ports(list/remove_images, list/add_images) - if(!see_hidden && current_user && current_user.client) + if(!see_hidden && current_user?.client) current_user.client.images -= remove_images current_user.client.images += add_images diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 8dd31572f38..5e100804f22 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -188,7 +188,7 @@ /obj/docking_port/stationary/register() if(!id) id = "dock" - else + else port_destinations = id if(!name) @@ -391,7 +391,7 @@ name = "shuttle" var/counter = 1 var/tmp_id = id - var/tmp_name = name + var/tmp_name = name while(Check_id(id)) counter++ id = "[tmp_id]_[counter]" @@ -543,7 +543,7 @@ var/underlying_area_type = SHUTTLE_DEFAULT_UNDERLYING_AREA // If the shuttle is docked to a stationary port, restore its normal // "empty" area and turf - if(current_dock && current_dock.area_type) + if(current_dock?.area_type) underlying_area_type = current_dock.area_type var/list/old_turfs = return_ordered_turfs(x, y, z, dir) @@ -691,7 +691,7 @@ for(var/place in shuttle_areas) var/area/shuttle/shuttle_area = place shuttle_area.parallax_movedir = FALSE - if(assigned_transit && assigned_transit.assigned_area) + if(assigned_transit?.assigned_area) assigned_transit.assigned_area.parallax_movedir = FALSE var/list/L0 = return_ordered_turfs(x, y, z, dir) for (var/thing in L0) @@ -817,7 +817,7 @@ /obj/docking_port/mobile/proc/getDbgStatusText() var/obj/docking_port/stationary/dockedAt = get_docked() - . = (dockedAt && dockedAt.name) ? dockedAt.name : "unknown" + . = (dockedAt?.name) ? dockedAt.name : "unknown" if(istype(dockedAt, /obj/docking_port/stationary/transit)) var/obj/docking_port/stationary/dst if(mode == SHUTTLE_RECALL) diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 213268c19db..30b89eaa860 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -311,7 +311,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th /obj/effect/proc_holder/spell/proc/perform(list/targets, recharge = TRUE, mob/user = usr) //if recharge is started is important for the trigger spells before_cast(targets) invocation(user) - if(user && user.ckey) + if(user?.ckey) user.log_message("cast the spell [name].", LOG_ATTACK) if(recharge) recharging = TRUE diff --git a/code/modules/spells/spell_types/area_teleport.dm b/code/modules/spells/spell_types/area_teleport.dm index b539781a987..5eb83e82450 100644 --- a/code/modules/spells/spell_types/area_teleport.dm +++ b/code/modules/spells/spell_types/area_teleport.dm @@ -52,7 +52,7 @@ to_chat(usr, "The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry.") return - if(target && target.buckled) + if(target?.buckled) target.buckled.unbuckle_mob(target, force=1) var/list/tempL = L diff --git a/code/modules/spells/spell_types/lichdom.dm b/code/modules/spells/spell_types/lichdom.dm index 411c1f2b312..ea3a3f5a0ba 100644 --- a/code/modules/spells/spell_types/lichdom.dm +++ b/code/modules/spells/spell_types/lichdom.dm @@ -137,7 +137,7 @@ var/turf/body_turf = get_turf(old_body) lich.Paralyze(200 + 200*resurrections) resurrections++ - if(old_body && old_body.loc) + if(old_body?.loc) if(iscarbon(old_body)) var/mob/living/carbon/C = old_body for(var/obj/item/W in C) diff --git a/code/modules/spells/spell_types/mime.dm b/code/modules/spells/spell_types/mime.dm index 1f6302b8963..c2b820a7da2 100644 --- a/code/modules/spells/spell_types/mime.dm +++ b/code/modules/spells/spell_types/mime.dm @@ -19,7 +19,7 @@ action_background_icon_state = "bg_mime" /obj/effect/proc_holder/spell/aoe_turf/conjure/mime_wall/Click() - if(usr && usr.mind) + if(usr?.mind) if(!usr.mind.miming) to_chat(usr, "You must dedicate yourself to silence first!") return @@ -49,7 +49,7 @@ action_background_icon_state = "bg_mime" /obj/effect/proc_holder/spell/aoe_turf/conjure/mime_chair/Click() - if(usr && usr.mind) + if(usr?.mind) if(!usr.mind.miming) to_chat(usr, "You must dedicate yourself to silence first!") return @@ -95,7 +95,7 @@ addtimer(CALLBACK(B, /obj/item/storage/box/mime/.proc/emptyStorage, FALSE), (summon_lifespan - 1)) /obj/effect/proc_holder/spell/aoe_turf/conjure/mime_box/Click() - if(usr && usr.mind) + if(usr?.mind) if(!usr.mind.miming) to_chat(usr, "You must dedicate yourself to silence first!") return @@ -165,7 +165,7 @@ action_background_icon_state = "bg_mime" /obj/effect/proc_holder/spell/targeted/forcewall/mime/Click() - if(usr && usr.mind) + if(usr?.mind) if(!usr.mind.miming) to_chat(usr, "You must dedicate yourself to silence first!") return @@ -203,7 +203,7 @@ if(owner.incapacitated()) to_chat(owner, "You can't properly point your fingers while incapacitated.") return - if(usr && usr.mind) + if(usr?.mind) if(!usr.mind.miming) to_chat(usr, "You must dedicate yourself to silence first!") return diff --git a/code/modules/spells/spell_types/projectile.dm b/code/modules/spells/spell_types/projectile.dm index 39f4858641f..c70e9988333 100644 --- a/code/modules/spells/spell_types/projectile.dm +++ b/code/modules/spells/spell_types/projectile.dm @@ -48,7 +48,7 @@ var/mob/M = target if(M.anti_magic_check(check_antimagic, check_holy)) return FALSE - if(ignored_factions && ignored_factions.len && faction_check(M.faction,ignored_factions)) + if(ignored_factions?.len && faction_check(M.faction,ignored_factions)) return FALSE diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index 89e29651d4b..b71ba6e4705 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -203,7 +203,7 @@ data["choiceB"] = "" if(user && completed) var/list/L = power_lottery[user] - if(L && L.len) + if(L?.len) data["used"] = FALSE data["choiceA"] = L[1] data["choiceB"] = L[2] diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index e2ac65498d4..119ca835dcc 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -531,7 +531,7 @@ /obj/item/organ/lungs/slime/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H) . = ..() - if (breath && breath.gases[/datum/gas/plasma]) + if (breath?.gases[/datum/gas/plasma]) var/plasma_pp = breath.get_breath_partial_pressure(breath.gases[/datum/gas/plasma][MOLES]) owner.blood_volume += (0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you. diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm index 46a4317fea4..ec1857768d8 100644 --- a/code/modules/tgui/external.dm +++ b/code/modules/tgui/external.dm @@ -158,7 +158,7 @@ // Name the verb, and hide it from the user panel. set name = "uiclose" set hidden = TRUE - var/mob/user = src && src.mob + var/mob/user = src?.mob if(!user) return // Close all tgui datums based on window_id. diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 549790ca537..4069122d184 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -857,7 +857,7 @@ ///Handles an actual AI (simple_animal mecha pilot) entering the mech /obj/vehicle/sealed/mecha/proc/aimob_enter_mech(mob/living/simple_animal/hostile/syndicate/mecha_pilot/pilot_mob) - if(pilot_mob && pilot_mob.Adjacent(src)) + if(pilot_mob?.Adjacent(src)) if(occupants) return LAZYADD(occupants, src)