diff --git a/GainStation13/code/mechanics/fatness.dm b/GainStation13/code/mechanics/fatness.dm index 370055a7..20d18373 100644 --- a/GainStation13/code/mechanics/fatness.dm +++ b/GainStation13/code/mechanics/fatness.dm @@ -28,8 +28,8 @@ fatness += amount_to_change fatness = max(fatness, MINIMUM_FATNESS_LEVEL) //It would be a little silly if someone got negative fat. - if(client.prefs.max_weight) - fatness = min(fatness, (client.prefs.max_weight - 1)) + if(client?.prefs?.max_weight) + fatness = min(fatness, (client?.prefs?.max_weight - 1)) return TRUE @@ -48,27 +48,27 @@ switch(type_of_fattening) if(FATTENING_TYPE_ITEM) - if(!client.prefs.weight_gain_items) + if(!client?.prefs?.weight_gain_items) return FALSE if(FATTENING_TYPE_FOOD) - if(!client.prefs.weight_gain_food) + if(!client?.prefs?.weight_gain_food) return FALSE if(FATTENING_TYPE_CHEM) - if(!client.prefs.weight_gain_chems) + if(!client?.prefs?.weight_gain_chems) return FALSE if(FATTENING_TYPE_WEAPON) - if(!client.prefs.weight_gain_weapons) + if(!client?.prefs?.weight_gain_weapons) return FALSE if(FATTENING_TYPE_MAGIC) - if(!client.prefs.weight_gain_magic) + if(!client?.prefs?.weight_gain_magic) return FALSE if(FATTENING_TYPE_VIRUS) - if(!client.prefs.weight_gain_viruses) + if(!client?.prefs?.weight_gain_viruses) return FALSE if(FATTENING_TYPE_WEIGHT_LOSS) diff --git a/GainStation13/code/mobs/chocoslime.dm b/GainStation13/code/mobs/chocoslime.dm index 7236d0dc..39bd1663 100644 --- a/GainStation13/code/mobs/chocoslime.dm +++ b/GainStation13/code/mobs/chocoslime.dm @@ -5,7 +5,7 @@ /mob/living/simple_animal/hostile/feed/AttackingTarget() . = ..() var/mob/living/carbon/L = target - if(L.client.prefs.weight_gain_weapons) + if(L.client?.prefs?.weight_gain_weapons) if(L.reagents) if(!L.is_mouth_covered(head_only = 1)) L.reagents.add_reagent(food_fed, food_per_feeding) diff --git a/GainStation13/code/modules/mob/living/emote.dm b/GainStation13/code/modules/mob/living/emote.dm index d29e92ee..899d964a 100644 --- a/GainStation13/code/modules/mob/living/emote.dm +++ b/GainStation13/code/modules/mob/living/emote.dm @@ -5,7 +5,7 @@ var/turf/source = get_turf(user) var/sound/noise = sound(gs13_get_sfx(noise_name)) for(var/mob/living/M in get_hearers_in_view(3, source)) - if ((pref_toggle == 0) || (M.client && M.client.prefs.cit_toggles & pref_toggle)) + if ((pref_toggle == 0) || (M.client && M.client?.prefs?.cit_toggles & pref_toggle)) M.playsound_local(source, noise_name, 50, 1, S = noise) /datum/emote/living/proc/reduce_fullness(var/mob/living/user, fullness_amount) // fullness_amount should be between 5 and 20 for balance and below 80 for functionality diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 0d64297b..55b24bf2 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -456,7 +456,7 @@ if(!M.key || !M.client || (ignore_category && GLOB.poll_ignore[ignore_category] && (M.ckey in GLOB.poll_ignore[ignore_category]))) continue if(be_special_flag) - if(!(M.client.prefs) || !(be_special_flag in M.client.prefs.be_special)) + if(!(M.client.prefs) || !(be_special_flag in M.client?.prefs?.be_special)) continue if(gametypeCheck) if(!gametypeCheck.age_check(M.client)) @@ -504,7 +504,7 @@ var/mob/living/carbon/human/new_character = new//The mob being spawned. SSjob.SendToLateJoin(new_character) - G_found.client.prefs.copy_to(new_character) + G_found.client?.prefs?.copy_to(new_character) new_character.dna.update_dna_identity() G_found.transfer_ckey(new_character, FALSE) @@ -538,8 +538,8 @@ return var/displayed_rank = rank - if(character.client && character.client.prefs && character.client.prefs.alt_titles_preferences[rank]) - displayed_rank = character.client.prefs.alt_titles_preferences[rank] + if(character.client && character.client.prefs && character.client?.prefs?.alt_titles_preferences[rank]) + displayed_rank = character.client?.prefs?.alt_titles_preferences[rank] var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems) announcer.announce("ARRIVAL", character.real_name, rank, displayed_rank, list()) //make the list empty to make it announce it in common diff --git a/code/__HELPERS/priority_announce.dm b/code/__HELPERS/priority_announce.dm index fa37e9ee..685bf1fb 100644 --- a/code/__HELPERS/priority_announce.dm +++ b/code/__HELPERS/priority_announce.dm @@ -33,7 +33,7 @@ for(var/mob/M in GLOB.player_list) if(!isnewplayer(M) && M.can_hear()) to_chat(M, announcement) - if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS) + if(M.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS) SEND_SOUND(M, s) /proc/print_command_report(text = "", title = null, announce=TRUE) @@ -56,7 +56,7 @@ for(var/mob/M in GLOB.player_list) if(!isnewplayer(M) && M.can_hear()) to_chat(M, "[html_encode(title)]
[html_encode(message)]

") - if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS) + if(M.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS) if(alert) SEND_SOUND(M, sound('sound/misc/notice1.ogg')) else diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 858b8dbd..630b5315 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -54,7 +54,7 @@ locked = !locked to_chat(usr, "Action button \"[name]\" [locked ? "" : "un"]locked.") if(id && usr.client) //try to (un)remember position - usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null + usr.client?.prefs?.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null return TRUE if(usr.next_click > world.time) return @@ -89,7 +89,7 @@ locked = !locked to_chat(usr, "Action button \"[name]\" [locked ? "" : "un"]locked.") if(id && usr.client) //try to (un)remember position - usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null + usr.client?.prefs?.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null return TRUE if(modifiers["alt"]) for(var/V in usr.actions) @@ -97,12 +97,12 @@ var/obj/screen/movable/action_button/B = A.button B.moved = FALSE if(B.id && usr.client) - usr.client.prefs.action_buttons_screen_locs["[B.name]_[B.id]"] = null - B.locked = usr.client.prefs.buttons_locked - locked = usr.client.prefs.buttons_locked + usr.client?.prefs?.action_buttons_screen_locs["[B.name]_[B.id]"] = null + B.locked = usr.client?.prefs?.buttons_locked + locked = usr.client?.prefs?.buttons_locked moved = FALSE if(id && usr.client) - usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = null + usr.client?.prefs?.action_buttons_screen_locs["[name]_[id]"] = null usr.update_action_buttons(TRUE) to_chat(usr, "Action button positions have been reset.") return TRUE diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm index 549b6346..60a99fe9 100644 --- a/code/_onclick/hud/ghost.dm +++ b/code/_onclick/hud/ghost.dm @@ -89,7 +89,7 @@ if(!.) return var/mob/screenmob = viewmob || mymob - if(!screenmob.client.prefs.ghost_hud) + if(!screenmob.client?.prefs?.ghost_hud) screenmob.client.screen -= static_inventory else screenmob.client.screen += static_inventory diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 5f233437..683d65c2 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -70,12 +70,12 @@ GLOBAL_LIST_INIT(available_ui_styles, list( if (!ui_style) // will fall back to the default if any of these are null - ui_style = ui_style2icon(owner.client && owner.client.prefs && owner.client.prefs.UI_style) + ui_style = ui_style2icon(owner.client && owner.client.prefs && owner.client?.prefs?.UI_style) hide_actions_toggle = new hide_actions_toggle.InitialiseIcon(src) if(mymob.client) - hide_actions_toggle.locked = mymob.client.prefs.buttons_locked + hide_actions_toggle.locked = mymob.client?.prefs?.buttons_locked hand_slots = list() diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index e54ede38..7417d1d5 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -85,7 +85,7 @@ owner.overlay_fullscreen("see_through_darkness", /obj/screen/fullscreen/see_through_darkness) var/widescreenlayout = FALSE //CIT CHANGE - adds support for different hud layouts depending on widescreen pref - if(owner.client && owner.client.prefs && owner.client.prefs.widescreenpref) //CIT CHANGE - ditto + if(owner.client && owner.client.prefs && owner.client?.prefs?.widescreenpref) //CIT CHANGE - ditto widescreenlayout = FALSE // CIT CHANGE - ditto var/obj/screen/using diff --git a/code/_onclick/hud/plane_master.dm b/code/_onclick/hud/plane_master.dm index ac749409..d51cd24d 100644 --- a/code/_onclick/hud/plane_master.dm +++ b/code/_onclick/hud/plane_master.dm @@ -51,7 +51,7 @@ blend_mode = BLEND_OVERLAY /obj/screen/plane_master/game_world/backdrop(mob/mymob) - if(istype(mymob) && mymob.client && mymob.client.prefs && mymob.client.prefs.ambientocclusion) + if(istype(mymob) && mymob.client && mymob.client.prefs && mymob.client?.prefs?.ambientocclusion) add_filter("ambient_occlusion", 0, AMBIENT_OCCLUSION) else remove_filter("ambient_occlusion") diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 00f84851..f190704f 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -247,7 +247,7 @@ usr.a_intent_change(INTENT_HOTKEY_RIGHT) /obj/screen/act_intent/segmented/Click(location, control, params) - if(usr.client.prefs.toggles & INTENT_STYLE) + if(usr.client?.prefs?.toggles & INTENT_STYLE) var/_x = text2num(params2list(params)["icon-x"]) var/_y = text2num(params2list(params)["icon-y"]) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index f76a745f..2ef9c152 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -50,7 +50,7 @@ if(user.client) if(IsAdminGhost(user)) attack_ai(user) - else if(user.client.prefs.inquisitive_ghost) + else if(user.client?.prefs?.inquisitive_ghost) user.examinate(src) return FALSE diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index 6aea7611..99aca6f1 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -111,13 +111,13 @@ SUBSYSTEM_DEF(job) if(job.required_playtime_remaining(player.client)) JobDebug("FOC player not enough xp, Player: [player]") continue - if(flag && (!(flag in player.client.prefs.be_special))) + if(flag && (!(flag in player.client?.prefs?.be_special))) JobDebug("FOC flag failed, Player: [player], Flag: [flag], ") continue if(player.mind && job.title in player.mind.restricted_roles) JobDebug("FOC incompatible with antagonist role, Player: [player]") continue - if(player.client.prefs.GetJobDepartment(job, level) & job.flag) + if(player.client?.prefs?.GetJobDepartment(job, level) & job.flag) JobDebug("FOC pass, Player: [player], Level:[level]") candidates += player return candidates @@ -333,7 +333,7 @@ SUBSYSTEM_DEF(job) continue // If the player wants that job on this level, then try give it to him. - if(player.client.prefs.GetJobDepartment(job, level) & job.flag) + if(player.client?.prefs?.GetJobDepartment(job, level) & job.flag) // If the job isn't filled if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1) JobDebug("DO pass, Player: [player], Level:[level], Job:[job.title]") @@ -360,17 +360,17 @@ SUBSYSTEM_DEF(job) /datum/controller/subsystem/job/proc/HandleUnassigned(mob/dead/new_player/player) if(PopcapReached()) RejectPlayer(player) - else if(player.client.prefs.joblessrole == BEOVERFLOW) + else if(player.client?.prefs?.joblessrole == BEOVERFLOW) var/allowed_to_be_a_loser = !jobban_isbanned(player, SSjob.overflow_role) if(QDELETED(player) || !allowed_to_be_a_loser) RejectPlayer(player) else if(!AssignRole(player, SSjob.overflow_role)) RejectPlayer(player) - else if(player.client.prefs.joblessrole == BERANDOMJOB) + else if(player.client?.prefs?.joblessrole == BERANDOMJOB) if(!GiveRandomJob(player)) RejectPlayer(player) - else if(player.client.prefs.joblessrole == RETURNTOLOBBY) + else if(player.client?.prefs?.joblessrole == RETURNTOLOBBY) RejectPlayer(player) else //Something gone wrong if we got here. var/message = "DO: [player] fell through handling unassigned" @@ -441,8 +441,8 @@ SUBSYSTEM_DEF(job) //Flavortext var/display_rank = rank - if(M.client && M.client.prefs && M.client.prefs.alt_titles_preferences[rank]) - display_rank = M.client.prefs.alt_titles_preferences[rank] + if(M.client && M.client.prefs && M.client?.prefs?.alt_titles_preferences[rank]) + display_rank = M.client?.prefs?.alt_titles_preferences[rank] to_chat(M, "You are the [display_rank].") @@ -522,11 +522,11 @@ SUBSYSTEM_DEF(job) if(job.required_playtime_remaining(player.client)) young++ continue - if(player.client.prefs.GetJobDepartment(job, 1) & job.flag) + if(player.client?.prefs?.GetJobDepartment(job, 1) & job.flag) high++ - else if(player.client.prefs.GetJobDepartment(job, 2) & job.flag) + else if(player.client?.prefs?.GetJobDepartment(job, 2) & job.flag) medium++ - else if(player.client.prefs.GetJobDepartment(job, 3) & job.flag) + else if(player.client?.prefs?.GetJobDepartment(job, 3) & job.flag) low++ else never++ //not selected SSblackbox.record_feedback("nested tally", "job_preferences", high, list("[job.title]", "high")) diff --git a/code/controllers/subsystem/jukeboxes.dm b/code/controllers/subsystem/jukeboxes.dm index 751dc801..482d57b1 100644 --- a/code/controllers/subsystem/jukeboxes.dm +++ b/code/controllers/subsystem/jukeboxes.dm @@ -37,7 +37,7 @@ SUBSYSTEM_DEF(jukeboxes) for(var/mob/M in GLOB.player_list) if(!M.client) continue - if(!(M.client.prefs.toggles & SOUND_INSTRUMENTS)) + if(!(M.client?.prefs?.toggles & SOUND_INSTRUMENTS)) continue M.playsound_local(M, null, 100, channel = youvegotafreejukebox[2], S = song_to_init) @@ -105,7 +105,7 @@ SUBSYSTEM_DEF(jukeboxes) for(var/mob/M in GLOB.player_list) if(!M.client) continue - if(!(M.client.prefs.toggles & SOUND_INSTRUMENTS) || !M.can_hear()) + if(!(M.client?.prefs?.toggles & SOUND_INSTRUMENTS) || !M.can_hear()) M.stop_sound_channel(jukeinfo[2]) continue diff --git a/code/controllers/subsystem/pai.dm b/code/controllers/subsystem/pai.dm index 0af3454e..e551e57e 100644 --- a/code/controllers/subsystem/pai.dm +++ b/code/controllers/subsystem/pai.dm @@ -146,7 +146,7 @@ SUBSYSTEM_DEF(pai) for(var/mob/dead/observer/G in GLOB.player_list) if(!G.key || !G.client) continue - if(!(ROLE_PAI in G.client.prefs.be_special)) + if(!(ROLE_PAI in G.client?.prefs?.be_special)) continue to_chat(G, "[user] is requesting a pAI personality! Use the pAI button to submit yourself as one.") addtimer(CALLBACK(src, .proc/spam_again), spam_delay) diff --git a/code/datums/action.dm b/code/datums/action.dm index 66e837c7..b091b331 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -66,8 +66,8 @@ M.actions += src if(M.client) M.client.screen += button - button.locked = M.client.prefs.buttons_locked || button.id ? M.client.prefs.action_buttons_screen_locs["[name]_[button.id]"] : FALSE //even if it's not defaultly locked we should remember we locked it before - button.moved = button.id ? M.client.prefs.action_buttons_screen_locs["[name]_[button.id]"] : FALSE + button.locked = M.client?.prefs?.buttons_locked || button.id ? M.client?.prefs?.action_buttons_screen_locs["[name]_[button.id]"] : FALSE //even if it's not defaultly locked we should remember we locked it before + button.moved = button.id ? M.client?.prefs?.action_buttons_screen_locs["[name]_[button.id]"] : FALSE M.update_action_buttons() else Remove(owner) diff --git a/code/datums/brain_damage/imaginary_friend.dm b/code/datums/brain_damage/imaginary_friend.dm index 65767a3d..bfa83875 100644 --- a/code/datums/brain_damage/imaginary_friend.dm +++ b/code/datums/brain_damage/imaginary_friend.dm @@ -143,7 +143,7 @@ return if (src.client) - if(client.prefs.muted & MUTE_IC) + if(client?.prefs?.muted & MUTE_IC) to_chat(src, "You cannot send IC messages (muted).") return if (!(ignore_spam || forced) && src.client.handle_spam_prevention(message,MUTE_IC)) @@ -152,7 +152,7 @@ friend_talk(message) /mob/camera/imaginary_friend/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source) - if (client?.prefs.chat_on_map && (client.prefs.see_chat_non_mob || ismob(speaker))) + if (client?.prefs.chat_on_map && (client?.prefs?.see_chat_non_mob || ismob(speaker))) create_chat_message(speaker, message_language, raw_message, spans, message_mode) to_chat(src, compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source)) diff --git a/code/datums/elements/flavor_text.dm b/code/datums/elements/flavor_text.dm index 1e0f6325..87dd0427 100644 --- a/code/datums/elements/flavor_text.dm +++ b/code/datums/elements/flavor_text.dm @@ -87,9 +87,9 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code examineTabOutput += "[L.name] " examineTabOutput += "([L.dna.custom_species ? L.dna.custom_species : L.dna.species.name])" -/* if(L.client.prefs.pins) //character has pins +/* if(L.client?.prefs?.pins) //character has pins var/P = "" - for(P in L.client.prefs.pins) + for(P in L.client?.prefs?.pins) examineTabOutput += "[icon2html('hyperstation/icons/chat/pins.dmi', world, P)]" //show pins! */ examineTabOutput += "" diff --git a/code/datums/emotes.dm b/code/datums/emotes.dm index fe3456f2..658a9244 100644 --- a/code/datums/emotes.dm +++ b/code/datums/emotes.dm @@ -64,7 +64,7 @@ if(!M.client || isnewplayer(M)) continue var/T = get_turf(user) - if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)) && (user.client)) //SKYRAT CHANGE - only user controlled mobs show their emotes to all-seeing ghosts, to reduce chat spam + if(M.stat == DEAD && M.client && (M.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null)) && (user.client)) //SKYRAT CHANGE - only user controlled mobs show their emotes to all-seeing ghosts, to reduce chat spam M.show_message(msg) if(emote_type == EMOTE_AUDIBLE) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 5a8222d6..3707e2ac 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -138,7 +138,7 @@ if(isliving(new_character)) //New humans and such are by default enabled arousal. Let's always use the new mind's prefs. var/mob/living/L = new_character if(L.client && L.client.prefs) - L.canbearoused = L.client.prefs.arousable //Technically this should make taking over a character mean the body gain the new minds setting... + L.canbearoused = L.client?.prefs?.arousable //Technically this should make taking over a character mean the body gain the new minds setting... L.update_arousal_hud() //Removes the old icon hide_ckey = current.client?.prefs?.hide_ckey @@ -290,7 +290,7 @@ var/obj/item/uplink_loc if(traitor_mob.client && traitor_mob.client.prefs) - switch(traitor_mob.client.prefs.uplink_spawn_loc) + switch(traitor_mob.client?.prefs?.uplink_spawn_loc) if(UPLINK_PDA) uplink_loc = PDA if(!uplink_loc) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 1a61d189..6c946e0e 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -454,11 +454,11 @@ GLOBAL_LIST_EMPTY(teleportlocs) return // Ambience goes down here -- make sure to list each area separately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch - if(L.client && !L.client.ambience_playing && L.client.prefs.toggles & SOUND_SHIP_AMBIENCE) + if(L.client && !L.client.ambience_playing && L.client?.prefs?.toggles & SOUND_SHIP_AMBIENCE) L.client.ambience_playing = 1 SEND_SOUND(L, sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = CHANNEL_BUZZ)) - if(!(L.client && (L.client.prefs.toggles & SOUND_AMBIENCE))) + if(!(L.client && (L.client?.prefs?.toggles & SOUND_AMBIENCE))) return //General ambience check is below the ship ambience so one can play without the other if(prob(35)) diff --git a/code/game/gamemodes/bloodsucker/bloodsucker.dm b/code/game/gamemodes/bloodsucker/bloodsucker.dm index 20631917..bcc45fec 100644 --- a/code/game/gamemodes/bloodsucker/bloodsucker.dm +++ b/code/game/gamemodes/bloodsucker/bloodsucker.dm @@ -202,7 +202,7 @@ // Convert to HUMAN (along with ID and PDA) if (!am_valid) H.set_species(/datum/species/human) - H.real_name = H.client.prefs.custom_names["human"] + H.real_name = H.client?.prefs?.custom_names["human"] var/obj/item/card/id/ID = H.wear_id?.GetID() if(ID) ID.registered_name = H.real_name diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 5a3d6268..c151abe2 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -69,7 +69,7 @@ GLOBAL_VAR(changeling_team_objective_type) //If this is not null, we hand our th if(changelings.len >= changelingcap) //Caps number of latejoin antagonists return if(changelings.len <= (changelingcap - 2) || prob(100 - (csc * 2))) - if(ROLE_CHANGELING in character.client.prefs.be_special) + if(ROLE_CHANGELING in character.client?.prefs?.be_special) if(!jobban_isbanned(character, ROLE_CHANGELING) && !QDELETED(character) && !jobban_isbanned(character, ROLE_SYNDICATE) && !QDELETED(character)) if(age_check(character.client)) if(!(character.job in restricted_jobs)) diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm index acb17d1b..d1d0d82b 100644 --- a/code/game/gamemodes/changeling/traitor_chan.dm +++ b/code/game/gamemodes/changeling/traitor_chan.dm @@ -68,7 +68,7 @@ ..() return if(changelings.len <= (changelingcap - 2) || prob(100 / (csc * 4))) - if(ROLE_CHANGELING in character.client.prefs.be_special) + if(ROLE_CHANGELING in character.client?.prefs?.be_special) if(!jobban_isbanned(character, ROLE_CHANGELING) && !QDELETED(character) && !jobban_isbanned(character, ROLE_SYNDICATE) && !QDELETED(character)) if(age_check(character.client)) if(!(character.job in restricted_jobs)) diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets.dm b/code/game/gamemodes/dynamic/dynamic_rulesets.dm index fa944b17..1b2ccf30 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets.dm @@ -194,7 +194,7 @@ if(P.mind.special_role) // We really don't want to give antag to an antag. candidates.Remove(P) continue - if (!(antag_flag in P.client.prefs.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override, ROLE_SYNDICATE))))//are they willing and not antag-banned? + if (!(antag_flag in P.client?.prefs?.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override, ROLE_SYNDICATE))))//are they willing and not antag-banned? candidates.Remove(P) continue @@ -214,7 +214,7 @@ if(P.mind.special_role || P.mind.antag_datums?.len > 0) // Are they an antag already? candidates.Remove(P) continue - if (!(antag_flag in P.client.prefs.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override, ROLE_SYNDICATE))))//are they willing and not antag-banned? + if (!(antag_flag in P.client?.prefs?.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override, ROLE_SYNDICATE))))//are they willing and not antag-banned? candidates.Remove(P) continue if ((exclusive_roles.len > 0) && !(P.mind.assigned_role in exclusive_roles)) // Is the rule exclusive to their job? @@ -224,4 +224,4 @@ /// Do your checks if the ruleset is ready to be executed here. /// Should ignore certain checks if forced is TRUE /datum/dynamic_ruleset/roundstart/ready(forced = FALSE) - return ..() \ No newline at end of file + return ..() diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_events.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_events.dm index 89d5b514..014c1470 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_events.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_events.dm @@ -82,7 +82,7 @@ if(!mode.check_age(M.client, minimum_required_age)) trimmed_list.Remove(M) continue - if (!(antag_name in M.client.prefs.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned? + if (!(antag_name in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned? trimmed_list.Remove(M) continue if (M.mind) diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm index f59f2d87..9e5249de 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm @@ -12,7 +12,7 @@ if(!mode.check_age(P.client, minimum_required_age)) candidates.Remove(P) continue - if (!(antag_flag in P.client.prefs.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override))))//are they willing and not antag-banned? + if (!(antag_flag in P.client?.prefs?.be_special) || jobban_isbanned(P.ckey, list(antag_flag, ROLE_SYNDICATE)) || (antag_flag_override && jobban_isbanned(P.ckey, list(antag_flag_override))))//are they willing and not antag-banned? candidates.Remove(P) continue if (P.mind.assigned_role in restricted_roles) // Does their job allow for it? diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm index f1032541..1f4e3ce8 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm @@ -52,7 +52,7 @@ if(!mode.check_age(M.client, minimum_required_age)) trimmed_list.Remove(M) continue - if (!(antag_name in M.client.prefs.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned? + if (!(antag_name in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned? trimmed_list.Remove(M) continue if (M.mind) @@ -77,11 +77,11 @@ trimmed_list.Remove(M) continue if(antag_flag_override) - if(!(antag_flag_override in M.client.prefs.be_special) || jobban_isbanned(M.ckey, antag_flag_override)) + if(!(antag_flag_override in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, antag_flag_override)) trimmed_list.Remove(M) continue else - if(!(antag_flag in M.client.prefs.be_special) || jobban_isbanned(M.ckey, antag_flag)) + if(!(antag_flag in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, antag_flag)) trimmed_list.Remove(M) continue return trimmed_list @@ -257,7 +257,7 @@ if(issilicon(player)) // Your assigned role doesn't change when you are turned into a silicon. living_players -= player continue - if(player.client.prefs.allow_midround_antag == 0) //Do they have midround traitor prefs enabled? If not, trim. + if(player.client?.prefs?.allow_midround_antag == 0) //Do they have midround traitor prefs enabled? If not, trim. living_players -= player continue if(is_centcom_level(player.z)) @@ -361,7 +361,7 @@ if(!mode.check_age(M.client, minimum_required_age)) trimmed_list.Remove(M) continue - if (!(antag_name in M.client.prefs.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned? + if (!(antag_name in M.client?.prefs?.be_special) || jobban_isbanned(M.ckey, list(antag_name, ROLE_SYNDICATE)))//are they willing and not antag-banned? trimmed_list.Remove(M) continue if (M.mind) @@ -378,7 +378,7 @@ /datum/dynamic_ruleset/midround/autotraitor/lewd/ready() for(var/mob/living/target in living_players) - if(target.client.prefs.noncon) + if(target.client?.prefs?.noncon) targets += target if(lewd_candidates.len) diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm index 3f4ff87d..f7ff0724 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm @@ -94,7 +94,7 @@ var/list/mob/living/carbon/human/targets = list() for(var/mob/dead/new_player/target in GLOB.player_list) - if(target.client.prefs.noncon) + if(target.client?.prefs?.noncon) targets += target if(candidates.len) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 1f7b8216..b1e0f71c 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -152,7 +152,7 @@ var/list/antag_candidates = list() for(var/mob/living/carbon/human/H in living_crew) - if(H.client && H.client.prefs.allow_midround_antag) + if(H.client && H.client?.prefs?.allow_midround_antag) antag_candidates += H if(!antag_candidates) @@ -359,7 +359,7 @@ for(var/mob/dead/new_player/player in players) if(player.client && player.ready == PLAYER_READY_TO_PLAY) - if(role in player.client.prefs.be_special) + if(role in player.client?.prefs?.be_special) if(!jobban_isbanned(player, ROLE_SYNDICATE) && !QDELETED(player) && !jobban_isbanned(player, role) && !QDELETED(player)) //Nodrak/Carn: Antag Job-bans if(age_check(player.client)) //Must be older than the minimum age candidates += player.mind // Get a list of all the people who want to be the antagonist for this round @@ -373,7 +373,7 @@ if(candidates.len < recommended_enemies) for(var/mob/dead/new_player/player in players) if(player.client && player.ready == PLAYER_READY_TO_PLAY) - if(!(role in player.client.prefs.be_special)) // We don't have enough people who want to be antagonist, make a separate list of people who don't want to be one + if(!(role in player.client?.prefs?.be_special)) // We don't have enough people who want to be antagonist, make a separate list of people who don't want to be one if(!jobban_isbanned(player, ROLE_SYNDICATE) && !QDELETED(player) && !jobban_isbanned(player, role) && !QDELETED(player) ) //Nodrak/Carn: Antag Job-bans drafted += player.mind diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 5a896926..fdd400f1 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -84,7 +84,7 @@ if((SSticker.mode.traitors.len + pre_traitors.len) >= traitorcap) //Upper cap for number of latejoin antagonists return if((SSticker.mode.traitors.len + pre_traitors.len) <= (traitorcap - 2) || prob(100 / (tsc * 2))) - if(antag_flag in character.client.prefs.be_special) + if(antag_flag in character.client?.prefs?.be_special) if(!jobban_isbanned(character, ROLE_TRAITOR) && !QDELETED(character) && !jobban_isbanned(character, ROLE_SYNDICATE) && !QDELETED(character)) if(age_check(character.client)) if(!(character.job in restricted_jobs)) @@ -96,4 +96,4 @@ /datum/game_mode/traitor/generate_report() return "Although more specific threats are commonplace, you should always remain vigilant for Syndicate agents aboard your station. Syndicate communications have implied that many \ - GATO employees are Syndicate agents with hidden memories that may be activated at a moment's notice, so it's possible that these agents might not even know their positions." \ No newline at end of file + GATO employees are Syndicate agents with hidden memories that may be activated at a moment's notice, so it's possible that these agents might not even know their positions." diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 628e7cd1..38971005 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -402,7 +402,7 @@ //Do the resize on ejection. The clone pod seems to do a lot of matrix transforms the way size code does, so we will handle our resize after. mob_occupant.previous_size = 1 //Set the previous size to default so the resize properly set health and speed. - mob_occupant.custom_body_size = size //mob_occupant.client.prefs.body_size + mob_occupant.custom_body_size = size //mob_occupant.client?.prefs?.body_size mob_occupant.resize(mob_occupant.custom_body_size * 0.01) occupant = null diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index a5365127..4ae5c871 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -433,7 +433,7 @@ . = ..() if(active) for(var/mob/living/M in range(10,src)) - if(!M.client || !(M.client.prefs.toggles & SOUND_INSTRUMENTS)) + if(!M.client || !(M.client?.prefs?.toggles & SOUND_INSTRUMENTS)) continue if(!(M in rangers)) rangers += M diff --git a/code/game/machinery/telecomms/broadcasting.dm b/code/game/machinery/telecomms/broadcasting.dm index 4e3e11d1..6be6ee4b 100644 --- a/code/game/machinery/telecomms/broadcasting.dm +++ b/code/game/machinery/telecomms/broadcasting.dm @@ -171,12 +171,12 @@ // Cut out mobs with clients who are admins and have radio chatter disabled. for(var/mob/R in receive) - if (R.client && R.client.holder && !(R.client.prefs.chat_toggles & CHAT_RADIO)) + if (R.client && R.client.holder && !(R.client?.prefs?.chat_toggles & CHAT_RADIO)) receive -= R // Add observers who have ghost radio enabled. for(var/mob/dead/observer/M in GLOB.player_list) - if(M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTRADIO)) + if(M.client && (M.client?.prefs?.chat_toggles & CHAT_GHOSTRADIO)) receive |= M // Render the message and have everybody hear it. diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 43ac13fb..c0722167 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -787,8 +787,8 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) openToolTip(user,src,params,title = name,content = "[desc]
Force: [force_string]",theme = "") /obj/item/MouseEntered(location, control, params) - if((item_flags & IN_INVENTORY) && usr.client.prefs.enable_tips && !QDELETED(src)) - var/timedelay = usr.client.prefs.tip_delay/100 + if((item_flags & IN_INVENTORY) && usr.client?.prefs?.enable_tips && !QDELETED(src)) + var/timedelay = usr.client?.prefs?.tip_delay/100 var/user = usr tip_timer = addtimer(CALLBACK(src, .proc/openTip, location, control, params, user), timedelay, TIMER_STOPPABLE)//timer takes delay in deciseconds, but the pref is in milliseconds. dividing by 100 converts it. diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 8f540525..732c83aa 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -164,8 +164,8 @@ GLOBAL_LIST_EMPTY(PDAs) if(equipped) return if(user.client) - background_color = user.client.prefs.pda_color - switch(user.client.prefs.pda_style) + background_color = user.client?.prefs?.pda_color + switch(user.client?.prefs?.pda_style) if(MONO) font_index = MODE_MONO font_mode = FONT_MONO @@ -181,7 +181,7 @@ GLOBAL_LIST_EMPTY(PDAs) else font_index = MODE_MONO font_mode = FONT_MONO - var/pref_skin = GLOB.pda_reskins[user.client.prefs.pda_skin] + var/pref_skin = GLOB.pda_reskins[user.client?.prefs?.pda_skin] if(icon != pref_skin) icon = pref_skin update_icon(FALSE, TRUE) @@ -778,7 +778,7 @@ GLOBAL_LIST_EMPTY(PDAs) // Show it to ghosts var/ghost_message = "[owner] PDA Message --> [target_text]: [signal.format_message(TRUE)]" for(var/mob/M in GLOB.player_list) - if(isobserver(M) && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTPDA)) + if(isobserver(M) && M.client && (M.client?.prefs?.chat_toggles & CHAT_GHOSTPDA)) to_chat(M, "[FOLLOW_LINK(M, user)] [ghost_message]") // Log in the talk log user.log_talk(message, LOG_PDA, tag="PDA: [initial(name)] to [target_text]") diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm index d4790cf7..dcb5cb4b 100644 --- a/code/game/objects/items/devices/dogborg_sleeper.dm +++ b/code/game/objects/items/devices/dogborg_sleeper.dm @@ -78,7 +78,7 @@ if(!iscarbon(target)) return var/voracious = TRUE - if(!target.client || !(target.client.prefs.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER)) + if(!target.client || !(target.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER)) voracious = FALSE if(target.buckled) to_chat(user, "The user is buckled and can not be put into your [src].") @@ -121,7 +121,7 @@ if(user.a_intent == INTENT_HELP) return var/voracious = TRUE - if(!user.client || !(user.client.prefs.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER)) + if(!user.client || !(user.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER)) voracious = FALSE user.visible_message("You see [voracious ? "[user] struggling against the expanded material of [hound]'s gut!" : "and hear [user] pounding against something inside of [hound]'s [src.name]!"]", \ "[voracious ? "You start struggling inside of [src]'s tight, flexible confines," : "You start pounding against the metallic walls of [src],"] trying to trigger the release... (this will take about [DisplayTimeText(breakout_time)].)", \ @@ -136,11 +136,11 @@ var/list/targets = target && hound ? list(target) : contents if(hound) //hound.setClickCooldown(50) Not needed? - if(!hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER)) + if(!hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER)) voracious = FALSE else for(var/mob/M in targets) - if(!M.client || !(M.client.prefs.cit_toggles & MEDIHOUND_SLEEPER)) + if(!M.client || !(M.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER)) voracious = FALSE if(length(targets)) if(hound) @@ -263,7 +263,7 @@ patient_laststat = patient.stat prociconupdate = TRUE - if(!patient.client || !(patient.client.prefs.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER)) + if(!patient.client || !(patient.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER)) hound.sleeper_nv = TRUE else hound.sleeper_nv = FALSE @@ -288,7 +288,7 @@ hound.sleeper_g = 1 patient_laststat = patient.stat - if(!patient.client || !(patient.client.prefs.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client.prefs.cit_toggles & MEDIHOUND_SLEEPER)) + if(!patient.client || !(patient.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER) || !hound.client || !(hound.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER)) hound.sleeper_nv = TRUE else hound.sleeper_nv = FALSE @@ -345,7 +345,7 @@ var/turf/source = get_turf(hound) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time @@ -389,7 +389,7 @@ var/turf/source = get_turf(hound) LAZYCLEARLIST(hearing_mobs) for(var/mob/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time diff --git a/code/game/objects/structures/life_candle.dm b/code/game/objects/structures/life_candle.dm index 0ae0e294..475d80c0 100644 --- a/code/game/objects/structures/life_candle.dm +++ b/code/game/objects/structures/life_candle.dm @@ -81,7 +81,7 @@ body = new mob_type(T) var/mob/ghostie = mind.get_ghost(TRUE) if(ghostie.client && ghostie.client.prefs) - ghostie.client.prefs.copy_to(body) + ghostie.client?.prefs?.copy_to(body) mind.transfer_to(body) else body.forceMove(T) diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index df6d033a..419c60dc 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -67,7 +67,7 @@ if((world.time - MUSICIAN_HEARCHECK_MINDELAY) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/M in get_hearers_in_view(15, source)) - if(!M.client || !(M.client.prefs.toggles & SOUND_INSTRUMENTS)) + if(!M.client || !(M.client?.prefs?.toggles & SOUND_INSTRUMENTS)) continue LAZYADD(hearing_mobs, M) last_hearcheck = world.time diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 9596b91f..6f6ff516 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -104,7 +104,7 @@ if(M.client) body += "| Prison | " body += "\ Send back to Lobby | " - var/muted = M.client.prefs.muted + var/muted = M.client?.prefs?.muted body += "
Mute: " body += "\[IC | " body += "OOC | " diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index 2323de4e..1dd2d413 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -743,7 +743,7 @@ if (length(players)) var/mob/chosen = players[1] if (chosen.client) - chosen.client.prefs.copy_to(spawnedMob) + chosen.client?.prefs?.copy_to(spawnedMob) spawnedMob.key = chosen.key players -= chosen if (ishuman(spawnedMob) && ispath(humanoutfit, /datum/outfit)) diff --git a/code/modules/admin/sound_emitter.dm b/code/modules/admin/sound_emitter.dm index 702e2071..fbc8ab0c 100644 --- a/code/modules/admin/sound_emitter.dm +++ b/code/modules/admin/sound_emitter.dm @@ -142,7 +142,7 @@ if(SOUND_EMITTER_GLOBAL) hearing_mobs = GLOB.player_list.Copy() for(var/mob/M in hearing_mobs) - if(M.client.prefs.toggles & SOUND_MIDI) + if(M.client?.prefs?.toggles & SOUND_MIDI) M.playsound_local(M, sound_file, sound_volume, FALSE, channel = CHANNEL_ADMIN, pressure_affected = FALSE) if(user) log_admin("[ADMIN_LOOKUPFLW(user)] activated a sound emitter with file \"[sound_file]\" at [AREACOORD(src)]") diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 4df6f226..e19dc832 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -26,7 +26,7 @@ for (var/mob/M in GLOB.player_list) if(isnewplayer(M)) continue - if (M.stat == DEAD || (M.client && M.client.holder && (M.client.prefs.chat_toggles & CHAT_DEAD))) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above + if (M.stat == DEAD || (M.client && M.client.holder && (M.client?.prefs?.chat_toggles & CHAT_DEAD))) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above to_chat(M, rendered) SSblackbox.record_feedback("tally", "admin_verb", 1, "Dsay") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 39dac328..6361fa42 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -32,7 +32,7 @@ /datum/admins/proc/isReadytoRumble(mob/living/carbon/human/applicant, targetrole, onstation = TRUE, conscious = TRUE) if(applicant.mind.special_role) return FALSE - if(!(targetrole in applicant.client.prefs.be_special)) + if(!(targetrole in applicant.client?.prefs?.be_special)) return FALSE if(onstation) var/turf/T = get_turf(applicant) @@ -412,7 +412,7 @@ //Spawn the body var/mob/living/carbon/human/ERTOperative = new ertemplate.mobtype(spawnloc) - chosen_candidate.client.prefs.copy_to(ERTOperative) + chosen_candidate.client?.prefs?.copy_to(ERTOperative) ERTOperative.key = chosen_candidate.key if(ertemplate.enforce_human || ERTOperative.dna.species.dangerous_existence) // Don't want any exploding plasmemes diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index cbbec40f..13766ba0 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -33,7 +33,7 @@ message_admins("[key_name_admin(src)] played sound [S]") for(var/mob/M in GLOB.player_list) - if(M.client.prefs.toggles & SOUND_MIDI) + if(M.client?.prefs?.toggles & SOUND_MIDI) var/user_vol = M.client.chatOutput.adminMusicVolume if(user_vol) admin_sound.volume = vol * (user_vol / 100) diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index f3da1954..4ef300d0 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -11,7 +11,7 @@ return log_prayer("[src.key]/([src.name]): [msg]") if(usr.client) - if(usr.client.prefs.muted & MUTE_PRAY) + if(usr.client?.prefs?.muted & MUTE_PRAY) to_chat(usr, "You cannot pray (muted).") return if(src.client.handle_spam_prevention(msg,MUTE_PRAY)) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index e426765f..c8e9b071 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -288,7 +288,7 @@ for(var/mob/M in GLOB.player_list) if(M.stat != DEAD) continue //we are not dead! - if(!(ROLE_ALIEN in M.client.prefs.be_special)) + if(!(ROLE_ALIEN in M.client?.prefs?.be_special)) continue //we don't want to be an alium if(M.client.is_afk()) continue //we are afk diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index 2fc0a801..ef93c231 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -181,7 +181,7 @@ GLOBAL_LIST_EMPTY(antagonists) /datum/antagonist/proc/enabled_in_preferences(datum/mind/M) if(job_rank) - if(M.current && M.current.client && (job_rank in M.current.client.prefs.be_special)) + if(M.current && M.current.client && (job_rank in M.current.client?.prefs?.be_special)) return TRUE else return FALSE diff --git a/code/modules/antagonists/blob/blob/overmind.dm b/code/modules/antagonists/blob/blob/overmind.dm index 0c83826a..74f9bf67 100644 --- a/code/modules/antagonists/blob/blob/overmind.dm +++ b/code/modules/antagonists/blob/blob/overmind.dm @@ -192,7 +192,7 @@ GLOBAL_LIST_EMPTY(blob_nodes) return if (src.client) - if(client.prefs.muted & MUTE_IC) + if(client?.prefs?.muted & MUTE_IC) to_chat(src, "You cannot send IC messages (muted).") return if (src.client.handle_spam_prevention(message,MUTE_IC)) diff --git a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm index 905f6034..7badabdb 100644 --- a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm +++ b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm @@ -80,7 +80,7 @@ /mob/camera/eminence/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null) if(client) - if(client.prefs.muted & MUTE_IC) + if(client?.prefs?.muted & MUTE_IC) to_chat(src, "You cannot send IC messages (muted).") return if(client.handle_spam_prevention(message,MUTE_IC)) diff --git a/code/modules/antagonists/revolution/revolution.dm b/code/modules/antagonists/revolution/revolution.dm index d30c9950..dcf4cde3 100644 --- a/code/modules/antagonists/revolution/revolution.dm +++ b/code/modules/antagonists/revolution/revolution.dm @@ -286,7 +286,7 @@ var/list/datum/mind/promotable = list() for(var/datum/mind/khrushchev in non_heads) if(khrushchev.current && !khrushchev.current.incapacitated() && !khrushchev.current.restrained() && khrushchev.current.client && khrushchev.current.stat != DEAD) - if(ROLE_REV in khrushchev.current.client.prefs.be_special) + if(ROLE_REV in khrushchev.current.client?.prefs?.be_special) promotable += khrushchev if(promotable.len) var/datum/mind/new_leader = pick(promotable) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index e7f96e05..4462c5d7 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -383,7 +383,7 @@ if(IsAdminGhost(user)) attack_ai(user) return FALSE - else if(user.client.prefs.inquisitive_ghost) + else if(user.client?.prefs?.inquisitive_ghost) user.examinate(src) return FALSE return FALSE diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index c0e71527..2a5dbd5b 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1025,7 +1025,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Widescreen: [widescreenpref ? "Enabled ([CONFIG_GET(string/default_view)])" : "Disabled (15x15)"]
" dat += "Auto stand: [autostand ? "Enabled" : "Disabled"]
" dat += "Screen Shake: [(screenshake==100) ? "Full" : ((screenshake==0) ? "None" : "[screenshake]")]
" - if (user && user.client && !user.client.prefs.screenshake==0) + if (user && user.client && !user.client?.prefs?.screenshake==0) dat += "Damage Screen Shake: [(damagescreenshake==1) ? "On" : ((damagescreenshake==0) ? "Off" : "Only when down")]
" //GS13 diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index d194dc55..34cc77c2 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -16,8 +16,8 @@ set name = "Game Preferences" set category = "Preferences" set desc = "Open Game Preferences Window" - usr.client.prefs.current_tab = 1 - usr.client.prefs.ShowChoices(usr) + usr.client?.prefs?.current_tab = 1 + usr.client?.prefs?.ShowChoices(usr) //toggles /datum/verbs/menu/Settings/Ghost/chatterbox @@ -27,10 +27,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_ears)( set name = "Show/Hide GhostEars" set category = "Preferences" set desc = "See All Speech" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTEARS - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTEARS) ? "see all speech in the world" : "only see speech from nearby mobs"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Ears", "[usr.client.prefs.chat_toggles & CHAT_GHOSTEARS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTEARS + to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTEARS) ? "see all speech in the world" : "only see speech from nearby mobs"].") + usr.client?.prefs?.save_preferences() + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Ears", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTEARS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_ears/Get_checked(client/C) return C.prefs.chat_toggles & CHAT_GHOSTEARS @@ -38,10 +38,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_sight) set name = "Show/Hide GhostSight" set category = "Preferences" set desc = "See All Emotes" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTSIGHT - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) ? "see all emotes in the world" : "only see emotes from nearby mobs"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Sight", "[usr.client.prefs.chat_toggles & CHAT_GHOSTSIGHT ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTSIGHT + to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT) ? "see all emotes in the world" : "only see emotes from nearby mobs"].") + usr.client?.prefs?.save_preferences() + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Sight", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_sight/Get_checked(client/C) return C.prefs.chat_toggles & CHAT_GHOSTSIGHT @@ -49,10 +49,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_whispe set name = "Show/Hide GhostWhispers" set category = "Preferences" set desc = "See All Whispers" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTWHISPER - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTWHISPER) ? "see all whispers in the world" : "only see whispers from nearby mobs"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Whispers", "[usr.client.prefs.chat_toggles & CHAT_GHOSTWHISPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTWHISPER + to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER) ? "see all whispers in the world" : "only see whispers from nearby mobs"].") + usr.client?.prefs?.save_preferences() + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Whispers", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_whispers/Get_checked(client/C) return C.prefs.chat_toggles & CHAT_GHOSTWHISPER @@ -62,10 +62,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_radio) set name = "Show/Hide GhostRadio" set category = "Preferences" set desc = "See All Radio Chatter" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTRADIO - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTRADIO) ? "see radio chatter" : "not see radio chatter"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Radio", "[usr.client.prefs.chat_toggles & CHAT_GHOSTRADIO ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //social experiment, increase the generation whenever you copypaste this shamelessly GENERATION 1 + usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTRADIO + to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTRADIO) ? "see radio chatter" : "not see radio chatter"].") + usr.client?.prefs?.save_preferences() + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost Radio", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTRADIO ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //social experiment, increase the generation whenever you copypaste this shamelessly GENERATION 1 /datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_radio/Get_checked(client/C) return C.prefs.chat_toggles & CHAT_GHOSTRADIO @@ -73,10 +73,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox, toggle_ghost_pda)() set name = "Show/Hide GhostPDA" set category = "Preferences" set desc = "See All PDA Messages" - usr.client.prefs.chat_toggles ^= CHAT_GHOSTPDA - to_chat(usr, "As a ghost, you will now [(usr.client.prefs.chat_toggles & CHAT_GHOSTPDA) ? "see all pda messages in the world" : "only see pda messages from nearby mobs"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost PDA", "[usr.client.prefs.chat_toggles & CHAT_GHOSTPDA ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + usr.client?.prefs?.chat_toggles ^= CHAT_GHOSTPDA + to_chat(usr, "As a ghost, you will now [(usr.client?.prefs?.chat_toggles & CHAT_GHOSTPDA) ? "see all pda messages in the world" : "only see pda messages from nearby mobs"].") + usr.client?.prefs?.save_preferences() + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ghost PDA", "[usr.client?.prefs?.chat_toggles & CHAT_GHOSTPDA ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Ghost/chatterbox/toggle_ghost_pda/Get_checked(client/C) return C.prefs.chat_toggles & CHAT_GHOSTPDA @@ -88,10 +88,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox/Events, toggle_death set name = "Toggle Deathrattle" set category = "Preferences" set desc = "Death" - usr.client.prefs.toggles ^= DISABLE_DEATHRATTLE - usr.client.prefs.save_preferences() - to_chat(usr, "You will [(usr.client.prefs.toggles & DISABLE_DEATHRATTLE) ? "no longer" : "now"] get messages when a sentient mob dies.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Deathrattle", "[!(usr.client.prefs.toggles & DISABLE_DEATHRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should spend some time reading the comments. + usr.client?.prefs?.toggles ^= DISABLE_DEATHRATTLE + usr.client?.prefs?.save_preferences() + to_chat(usr, "You will [(usr.client?.prefs?.toggles & DISABLE_DEATHRATTLE) ? "no longer" : "now"] get messages when a sentient mob dies.") + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Deathrattle", "[!(usr.client?.prefs?.toggles & DISABLE_DEATHRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should spend some time reading the comments. /datum/verbs/menu/Settings/Ghost/chatterbox/Events/toggle_deathrattle/Get_checked(client/C) return !(C.prefs.toggles & DISABLE_DEATHRATTLE) @@ -99,10 +99,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost/chatterbox/Events, toggle_arriv set name = "Toggle Arrivalrattle" set category = "Preferences" set desc = "New Player Arrival" - usr.client.prefs.toggles ^= DISABLE_ARRIVALRATTLE - to_chat(usr, "You will [(usr.client.prefs.toggles & DISABLE_ARRIVALRATTLE) ? "no longer" : "now"] get messages when someone joins the station.") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Arrivalrattle", "[!(usr.client.prefs.toggles & DISABLE_ARRIVALRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should rethink where your life went so wrong. + usr.client?.prefs?.toggles ^= DISABLE_ARRIVALRATTLE + to_chat(usr, "You will [(usr.client?.prefs?.toggles & DISABLE_ARRIVALRATTLE) ? "no longer" : "now"] get messages when someone joins the station.") + usr.client?.prefs?.save_preferences() + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Arrivalrattle", "[!(usr.client?.prefs?.toggles & DISABLE_ARRIVALRATTLE) ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, maybe you should rethink where your life went so wrong. /datum/verbs/menu/Settings/Ghost/chatterbox/Events/toggle_arrivalrattle/Get_checked(client/C) return !(C.prefs.toggles & DISABLE_ARRIVALRATTLE) @@ -110,10 +110,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Ghost, togglemidroundantag)() set name = "Toggle Midround Antagonist" set category = "Preferences" set desc = "Midround Antagonist" - usr.client.prefs.toggles ^= MIDROUND_ANTAG - usr.client.prefs.save_preferences() - to_chat(usr, "You will [(usr.client.prefs.toggles & MIDROUND_ANTAG) ? "now" : "no longer"] be considered for midround antagonist positions.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Midround Antag", "[usr.client.prefs.toggles & MIDROUND_ANTAG ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + usr.client?.prefs?.toggles ^= MIDROUND_ANTAG + usr.client?.prefs?.save_preferences() + to_chat(usr, "You will [(usr.client?.prefs?.toggles & MIDROUND_ANTAG) ? "now" : "no longer"] be considered for midround antagonist positions.") + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Midround Antag", "[usr.client?.prefs?.toggles & MIDROUND_ANTAG ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Ghost/togglemidroundantag/Get_checked(client/C) return C.prefs.toggles & MIDROUND_ANTAG @@ -121,16 +121,16 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggletitlemusic)() set name = "Hear/Silence Lobby Music" set category = "Preferences" set desc = "Hear Music In Lobby" - usr.client.prefs.toggles ^= SOUND_LOBBY - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_LOBBY) + usr.client?.prefs?.toggles ^= SOUND_LOBBY + usr.client?.prefs?.save_preferences() + if(usr.client?.prefs?.toggles & SOUND_LOBBY) to_chat(usr, "You will now hear music in the game lobby.") if(isnewplayer(usr)) usr.client.playtitlemusic() else to_chat(usr, "You will no longer hear music in the game lobby.") usr.stop_sound_channel(CHANNEL_LOBBYMUSIC) - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Lobby Music", "[usr.client.prefs.toggles & SOUND_LOBBY ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Lobby Music", "[usr.client?.prefs?.toggles & SOUND_LOBBY ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Sound/toggletitlemusic/Get_checked(client/C) return C.prefs.toggles & SOUND_LOBBY @@ -139,9 +139,9 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglemidis)() set name = "Hear/Silence Midis" set category = "Preferences" set desc = "Hear Admin Triggered Sounds (Midis)" - usr.client.prefs.toggles ^= SOUND_MIDI - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_MIDI) + usr.client?.prefs?.toggles ^= SOUND_MIDI + usr.client?.prefs?.save_preferences() + if(usr.client?.prefs?.toggles & SOUND_MIDI) to_chat(usr, "You will now hear any sounds uploaded by admins.") else to_chat(usr, "You will no longer hear sounds uploaded by admins") @@ -149,7 +149,7 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglemidis)() var/client/C = usr.client if(C && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded) C.chatOutput.stopMusic() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Hearing Midis", "[usr.client.prefs.toggles & SOUND_MIDI ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Hearing Midis", "[usr.client?.prefs?.toggles & SOUND_MIDI ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Sound/togglemidis/Get_checked(client/C) return C.prefs.toggles & SOUND_MIDI @@ -158,13 +158,13 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_instruments)() set name = "Hear/Silence Instruments" set category = "Preferences" set desc = "Hear In-game Instruments" - usr.client.prefs.toggles ^= SOUND_INSTRUMENTS - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_INSTRUMENTS) + usr.client?.prefs?.toggles ^= SOUND_INSTRUMENTS + usr.client?.prefs?.save_preferences() + if(usr.client?.prefs?.toggles & SOUND_INSTRUMENTS) to_chat(usr, "You will now hear people playing musical instruments.") else to_chat(usr, "You will no longer hear musical instruments.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Instruments", "[usr.client.prefs.toggles & SOUND_INSTRUMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Instruments", "[usr.client?.prefs?.toggles & SOUND_INSTRUMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Sound/toggle_instruments/Get_checked(client/C) return C.prefs.toggles & SOUND_INSTRUMENTS @@ -173,15 +173,15 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, Toggle_Soundscape)() set name = "Hear/Silence Ambience" set category = "Preferences" set desc = "Hear Ambient Sound Effects" - usr.client.prefs.toggles ^= SOUND_AMBIENCE - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_AMBIENCE) + usr.client?.prefs?.toggles ^= SOUND_AMBIENCE + usr.client?.prefs?.save_preferences() + if(usr.client?.prefs?.toggles & SOUND_AMBIENCE) to_chat(usr, "You will now hear ambient sounds.") else to_chat(usr, "You will no longer hear ambient sounds.") usr.stop_sound_channel(CHANNEL_AMBIENCE) usr.stop_sound_channel(CHANNEL_BUZZ) - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ambience", "[usr.client.prefs.toggles & SOUND_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ambience", "[usr.client?.prefs?.toggles & SOUND_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Sound/Toggle_Soundscape/Get_checked(client/C) return C.prefs.toggles & SOUND_AMBIENCE @@ -190,15 +190,15 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_ship_ambience)() set name = "Hear/Silence Ship Ambience" set category = "Preferences" set desc = "Hear Ship Ambience Roar" - usr.client.prefs.toggles ^= SOUND_SHIP_AMBIENCE - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_SHIP_AMBIENCE) + usr.client?.prefs?.toggles ^= SOUND_SHIP_AMBIENCE + usr.client?.prefs?.save_preferences() + if(usr.client?.prefs?.toggles & SOUND_SHIP_AMBIENCE) to_chat(usr, "You will now hear ship ambience.") else to_chat(usr, "You will no longer hear ship ambience.") usr.stop_sound_channel(CHANNEL_BUZZ) usr.client.ambience_playing = 0 - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ship Ambience", "[usr.client.prefs.toggles & SOUND_SHIP_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, I bet you read this comment expecting to see the same thing :^) + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Ship Ambience", "[usr.client?.prefs?.toggles & SOUND_SHIP_AMBIENCE ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, I bet you read this comment expecting to see the same thing :^) /datum/verbs/menu/Settings/Sound/toggle_ship_ambience/Get_checked(client/C) return C.prefs.toggles & SOUND_SHIP_AMBIENCE @@ -207,10 +207,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggle_announcement_sound)() set name = "Hear/Silence Announcements" set category = "Preferences" set desc = "Hear Announcement Sound" - usr.client.prefs.toggles ^= SOUND_ANNOUNCEMENTS - to_chat(usr, "You will now [(usr.client.prefs.toggles & SOUND_ANNOUNCEMENTS) ? "hear announcement sounds" : "no longer hear announcements"].") - usr.client.prefs.save_preferences() - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Announcement Sound", "[usr.client.prefs.toggles & SOUND_ANNOUNCEMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + usr.client?.prefs?.toggles ^= SOUND_ANNOUNCEMENTS + to_chat(usr, "You will now [(usr.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS) ? "hear announcement sounds" : "no longer hear announcements"].") + usr.client?.prefs?.save_preferences() + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Announcement Sound", "[usr.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Sound/toggle_announcement_sound/Get_checked(client/C) return C.prefs.toggles & SOUND_ANNOUNCEMENTS @@ -219,13 +219,13 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggleprayersounds)() set name = "Hear/Silence Prayer Sounds" set category = "Preferences" set desc = "Hear Prayer Sounds" - usr.client.prefs.toggles ^= SOUND_PRAYERS - usr.client.prefs.save_preferences() - if(usr.client.prefs.toggles & SOUND_PRAYERS) + usr.client?.prefs?.toggles ^= SOUND_PRAYERS + usr.client?.prefs?.save_preferences() + if(usr.client?.prefs?.toggles & SOUND_PRAYERS) to_chat(usr, "You will now hear prayer sounds.") else to_chat(usr, "You will no longer prayer sounds.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Sounds", "[usr.client.prefs.toggles & SOUND_PRAYERS ? "Enabled" : "Disabled"]")) + SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Prayer Sounds", "[usr.client?.prefs?.toggles & SOUND_PRAYERS ? "Enabled" : "Disabled"]")) /datum/verbs/menu/Settings/Sound/toggleprayersounds/Get_checked(client/C) return C.prefs.toggles & SOUND_PRAYERS @@ -244,10 +244,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings, listen_ooc)() set name = "Show/Hide OOC" set category = "Preferences" set desc = "Show OOC Chat" - usr.client.prefs.chat_toggles ^= CHAT_OOC - usr.client.prefs.save_preferences() - to_chat(usr, "You will [(usr.client.prefs.chat_toggles & CHAT_OOC) ? "now" : "no longer"] see messages on the OOC channel.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Seeing OOC", "[usr.client.prefs.chat_toggles & CHAT_OOC ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + usr.client?.prefs?.chat_toggles ^= CHAT_OOC + usr.client?.prefs?.save_preferences() + to_chat(usr, "You will [(usr.client?.prefs?.chat_toggles & CHAT_OOC) ? "now" : "no longer"] see messages on the OOC channel.") + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle Seeing OOC", "[usr.client?.prefs?.chat_toggles & CHAT_OOC ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/listen_ooc/Get_checked(client/C) return C.prefs.chat_toggles & CHAT_OOC diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 7625f229..99ab2991 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -433,8 +433,8 @@ if(glass_colour_type && ishuman(user)) var/mob/living/carbon/human/H = user if(H.client?.prefs && src == H.glasses) - H.client.prefs.uses_glasses_colour = !H.client.prefs.uses_glasses_colour - if(H.client.prefs.uses_glasses_colour) + H.client?.prefs?.uses_glasses_colour = !H.client?.prefs?.uses_glasses_colour + if(H.client?.prefs?.uses_glasses_colour) to_chat(H, "You will now see glasses colors.") else to_chat(H, "You will no longer see glasses colors.") @@ -453,7 +453,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 && 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/events/aurora_caelus.dm b/code/modules/events/aurora_caelus.dm index c467e610..18a21eb4 100644 --- a/code/modules/events/aurora_caelus.dm +++ b/code/modules/events/aurora_caelus.dm @@ -25,7 +25,7 @@ sender_override = "GATO Meteorology Division") for(var/V in GLOB.player_list) var/mob/M = V - if((M.client.prefs.toggles & SOUND_MIDI) && is_station_level(M.z)) + if((M.client?.prefs?.toggles & SOUND_MIDI) && is_station_level(M.z)) M.playsound_local(M, pick('sound/ambience/aurora_caelus_new.ogg','sound/ambience/aurora_caelus.ogg'), 40, FALSE, pressure_affected = FALSE) //ogg is "The Fire is Gone" by Heaven Pierce Her, used in the videogame ULTRAKILL. All respects and credits to the equivalent artists who worked on it. start_checking() diff --git a/code/modules/jobs/job_types/captain.dm b/code/modules/jobs/job_types/captain.dm index 41d08789..258dffe7 100644 --- a/code/modules/jobs/job_types/captain.dm +++ b/code/modules/jobs/job_types/captain.dm @@ -39,7 +39,7 @@ Captain throw EXCEPTION("[H.nameless ? "Captain" : "Captain [H.real_name]"] ([H.x],[H.y],[H.z]) has no client.") return - var/displayed_rank = H.client.prefs.alt_titles_preferences[title] + var/displayed_rank = H.client?.prefs?.alt_titles_preferences[title] if(!displayed_rank) //Default to Captain displayed_rank = "Captain" diff --git a/code/modules/jobs/job_types/civilian_chaplain.dm b/code/modules/jobs/job_types/civilian_chaplain.dm index 5f3daf1b..275d542d 100644 --- a/code/modules/jobs/job_types/civilian_chaplain.dm +++ b/code/modules/jobs/job_types/civilian_chaplain.dm @@ -39,12 +39,12 @@ Chaplain return var/new_religion = "Christianity" - if(M.client && M.client.prefs.custom_names["religion"]) - new_religion = M.client.prefs.custom_names["religion"] + if(M.client && M.client?.prefs?.custom_names["religion"]) + new_religion = M.client?.prefs?.custom_names["religion"] var/new_deity = "Space Jesus" - if(M.client && M.client.prefs.custom_names["deity"]) - new_deity = M.client.prefs.custom_names["deity"] + if(M.client && M.client?.prefs?.custom_names["deity"]) + new_deity = M.client?.prefs?.custom_names["deity"] B.deity_name = new_deity diff --git a/code/modules/jobs/job_types/security.dm b/code/modules/jobs/job_types/security.dm index 0b18fd65..099d4203 100644 --- a/code/modules/jobs/job_types/security.dm +++ b/code/modules/jobs/job_types/security.dm @@ -227,7 +227,7 @@ GLOBAL_LIST_INIT(available_depts, list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, S // Assign department security var/department if(M && M.client && M.client.prefs) - department = M.client.prefs.prefered_security_department + department = M.client?.prefs?.prefered_security_department if(!LAZYLEN(GLOB.available_depts) || department == "None") return else if(department in GLOB.available_depts) @@ -387,7 +387,7 @@ Junior Security Officer // Assign department security var/department if(M && M.client && M.client.prefs) - department = M.client.prefs.prefered_security_department + department = M.client?.prefs?.prefered_security_department if(!LAZYLEN(GLOB.available_depts) || department == "None") return else if(department in GLOB.available_depts) diff --git a/code/modules/mob/dead/new_player/login.dm b/code/modules/mob/dead/new_player/login.dm index acd96641..3b371103 100644 --- a/code/modules/mob/dead/new_player/login.dm +++ b/code/modules/mob/dead/new_player/login.dm @@ -37,8 +37,8 @@ postfix = "soon" to_chat(src, "Please set up your character and select \"Ready\". The game will start [postfix].") - if(client.prefs.path) //Hyper edit: notify of a newer preference version - var/savefile/S = new /savefile(client.prefs.path) + if(client?.prefs?.path) //Hyper edit: notify of a newer preference version + var/savefile/S = new /savefile(client?.prefs?.path) if(S) S.cd = "/" var/slot diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index b8a14a9d..25305c16 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -32,7 +32,7 @@ return /mob/dead/new_player/proc/new_player_panel() - var/output = "

Welcome, [client ? client.prefs.real_name : "Unknown User"]

" + var/output = "

Welcome, [client ? client?.prefs?.real_name : "Unknown User"]

" output += "

Setup Character

" if(SSticker.current_state <= GAME_STATE_PREGAME) @@ -93,7 +93,7 @@ relevant_cap = max(hpc, epc) if(href_list["show_preferences"]) - client.prefs.ShowChoices(src) + client?.prefs?.ShowChoices(src) return 1 if(href_list["ready"]) @@ -122,7 +122,7 @@ LateChoices() return - // if(client.prefs.real_name in client.pastcharacters) //if character has been spawned before + // if(client?.prefs?.real_name in client.pastcharacters) //if character has been spawned before // to_chat(usr, "You have played that character before this round, please select a new one!") // return @@ -183,7 +183,7 @@ if(!ready && href_list["preference"]) if(client) - client.prefs.process_link(src, href_list) + client?.prefs?.process_link(src, href_list) else if(!href_list["late_join"]) new_player_panel() @@ -303,7 +303,7 @@ observer.client = client observer.set_ghost_appearance() if(observer.client && observer.client.prefs) - observer.real_name = observer.client.prefs.real_name + observer.real_name = observer.client?.prefs?.real_name observer.name = observer.real_name observer.client.init_verbs() observer.update_icon() @@ -346,11 +346,11 @@ if(jobban_isbanned(src,rank)) return JOB_UNAVAILABLE_BANNED if(job.whitelist_type) //whitelisting - if(job.whitelist_type == "roleplay" && !client.prefs.roleplayroles) + if(job.whitelist_type == "roleplay" && !client?.prefs?.roleplayroles) return JOB_UNAVAILABLE_WHITELIST - if(job.whitelist_type == "important" && !client.prefs.importantroles) + if(job.whitelist_type == "important" && !client?.prefs?.importantroles) return JOB_UNAVAILABLE_WHITELIST - if(job.whitelist_type == "silly" && !client.prefs.sillyroles) + if(job.whitelist_type == "silly" && !client?.prefs?.sillyroles) return JOB_UNAVAILABLE_WHITELIST if(QDELETED(src)) return JOB_UNAVAILABLE_GENERIC @@ -554,8 +554,8 @@ jobline += "[job.title] ([job.current_positions])" else jobline += "[job.title] ([job.current_positions])" - if(client && client.prefs && client.prefs.alt_titles_preferences[job.title]) - jobline += "
(as [client.prefs.alt_titles_preferences[job.title]])" + if(client && client.prefs && client?.prefs?.alt_titles_preferences[job.title]) + jobline += "
(as [client?.prefs?.alt_titles_preferences[job.title]])" dat += jobline categorizedJobs[jobcat]["jobs"] -= job @@ -588,9 +588,9 @@ if(QDELETED(src)) return if(frn) - client.prefs.random_character() - client.prefs.real_name = client.prefs.pref_species.random_name(gender,1) - client.prefs.copy_to(H) + client?.prefs?.random_character() + client?.prefs?.real_name = client?.prefs?.pref_species.random_name(gender,1) + client?.prefs?.copy_to(H) H.dna.update_dna_identity() if(mind) diff --git a/code/modules/mob/dead/observer/login.dm b/code/modules/mob/dead/observer/login.dm index 39ebdb96..8a126a93 100644 --- a/code/modules/mob/dead/observer/login.dm +++ b/code/modules/mob/dead/observer/login.dm @@ -3,16 +3,16 @@ if(!. || !client) return FALSE - ghost_accs = client.prefs.ghost_accs - ghost_others = client.prefs.ghost_others + ghost_accs = client?.prefs?.ghost_accs + ghost_others = client?.prefs?.ghost_others var/preferred_form = null if(IsAdminGhost(src)) has_unlimited_silicon_privilege = 1 - if(client.prefs.unlock_content) - preferred_form = client.prefs.ghost_form - ghost_orbit = client.prefs.ghost_orbit + if(client?.prefs?.unlock_content) + preferred_form = client?.prefs?.ghost_form + ghost_orbit = client?.prefs?.ghost_orbit var/turf/T = get_turf(src) if (isturf(T)) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 10ee3b14..7a4b2cd4 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -175,8 +175,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) /mob/dead/observer/update_icon(new_form) . = ..() if(client) //We update our preferences in case they changed right before update_icon was called. - ghost_accs = client.prefs.ghost_accs - ghost_others = client.prefs.ghost_others + ghost_accs = client?.prefs?.ghost_accs + ghost_others = client?.prefs?.ghost_others if(hair_overlay) cut_overlay(hair_overlay) @@ -268,9 +268,9 @@ Works together with spawning an observer, noted above. var/mob/dead/observer/ghost = new(get_turf(src), src) // Transfer safety to observer spawning proc. SStgui.on_transfer(src, ghost) // Transfer NanoUIs. ghost.can_reenter_corpse = can_reenter_corpse - if (client && client.prefs && client.prefs.auto_ooc) - if (!(client.prefs.chat_toggles & CHAT_OOC)) - client.prefs.chat_toggles ^= CHAT_OOC + if (client && client.prefs && client?.prefs?.auto_ooc) + if (!(client?.prefs?.chat_toggles & CHAT_OOC)) + client?.prefs?.chat_toggles ^= CHAT_OOC transfer_ckey(ghost, FALSE) ghost.AddElement(/datum/element/ghost_role_eligibility,penalize) // technically already run earlier, but this adds the penalty // needs to be done AFTER the ckey transfer, too @@ -378,8 +378,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(source) var/obj/screen/alert/A = throw_alert("[REF(source)]_notify_cloning", /obj/screen/alert/notify_cloning) if(A) - if(client && client.prefs && client.prefs.UI_style) - A.icon = ui_style2icon(client.prefs.UI_style) + if(client && client.prefs && client?.prefs?.UI_style) + A.icon = ui_style2icon(client?.prefs?.UI_style) A.desc = message var/old_layer = source.layer var/old_plane = source.plane @@ -506,7 +506,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "View Range" set desc = "Change your view range." - var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT + var/max_view = client?.prefs?.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT if(client.view == CONFIG_GET(string/default_view)) var/list/views = list() for(var/i in 7 to max_view) @@ -520,7 +520,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/verb/add_view_range(input as num) set name = "Add View Range" set hidden = TRUE - var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT + var/max_view = client?.prefs?.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT if(input) client.rescale_view(input, 15, (max_view*2)+1) @@ -573,7 +573,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/update_sight() if(client) - ghost_others = client.prefs.ghost_others //A quick update just in case this setting was changed right before calling the proc + ghost_others = client?.prefs?.ghost_others //A quick update just in case this setting was changed right before calling the proc if (!ghostvision) see_invisible = SEE_INVISIBLE_LIVING @@ -601,11 +601,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp client.images -= GLOB.ghost_images_default if(GHOST_OTHERS_SIMPLE) client.images -= GLOB.ghost_images_simple - lastsetting = client.prefs.ghost_others + lastsetting = client?.prefs?.ghost_others if(!ghostvision) return - if(client.prefs.ghost_others != GHOST_OTHERS_THEIR_SETTING) - switch(client.prefs.ghost_others) + if(client?.prefs?.ghost_others != GHOST_OTHERS_THEIR_SETTING) + switch(client?.prefs?.ghost_others) if(GHOST_OTHERS_DEFAULT_SPRITE) client.images |= (GLOB.ghost_images_default-ghostimage_default) if(GHOST_OTHERS_SIMPLE) @@ -741,23 +741,23 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set_ghost_appearance() if(client && client.prefs) - deadchat_name = client.prefs.real_name + deadchat_name = client?.prefs?.real_name /mob/dead/observer/proc/set_ghost_appearance() if((!client) || (!client.prefs)) return - if(client.prefs.be_random_name) - client.prefs.real_name = random_unique_name(gender) - if(client.prefs.be_random_body) - client.prefs.random_character(gender) + if(client?.prefs?.be_random_name) + client?.prefs?.real_name = random_unique_name(gender) + if(client?.prefs?.be_random_body) + client?.prefs?.random_character(gender) - if(HAIR in client.prefs.pref_species.species_traits) - hair_style = client.prefs.hair_style - hair_color = brighten_color(client.prefs.hair_color) - if(FACEHAIR in client.prefs.pref_species.species_traits) - facial_hair_style = client.prefs.facial_hair_style - facial_hair_color = brighten_color(client.prefs.facial_hair_color) + if(HAIR in client?.prefs?.pref_species.species_traits) + hair_style = client?.prefs?.hair_style + hair_color = brighten_color(client?.prefs?.hair_color) + if(FACEHAIR in client?.prefs?.pref_species.species_traits) + facial_hair_style = client?.prefs?.facial_hair_style + facial_hair_color = brighten_color(client?.prefs?.facial_hair_color) update_icon() diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index a365c1c4..10e27c37 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -34,7 +34,7 @@ to_follow = V.source var/link = FOLLOW_LINK(src, to_follow) // Create map text prior to modifying message for goonchat - if (client?.prefs.chat_on_map && (client.prefs.see_chat_non_mob || ismob(speaker))) + if (client?.prefs.chat_on_map && (client?.prefs?.see_chat_non_mob || ismob(speaker))) create_chat_message(speaker, message_language, raw_message, spans, message_mode) // Recompose the message, because it's scrambled by default message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode, FALSE, source) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 39ac55c5..8d10230e 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -313,7 +313,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) C.canbearoused = FALSE else if(C.client) - C.canbearoused = C.client.prefs.arousable + C.canbearoused = C.client?.prefs?.arousable if(ishuman(C)) var/mob/living/carbon/human/H = C if(NOGENITALS in H.dna.species.species_traits) diff --git a/code/modules/mob/living/carbon/human/species_types/mothmen.dm b/code/modules/mob/living/carbon/human/species_types/mothmen.dm index 70d9fd91..ab6952cc 100644 --- a/code/modules/mob/living/carbon/human/species_types/mothmen.dm +++ b/code/modules/mob/living/carbon/human/species_types/mothmen.dm @@ -21,7 +21,7 @@ if(ishuman(C)) var/mob/living/carbon/human/H = C if(!H.dna.features["moth_wings"]) - H.dna.features["moth_wings"] = "[(H.client && H.client.prefs && LAZYLEN(H.client.prefs.features) && H.client.prefs.features["moth_wings"]) ? H.client.prefs.features["moth_wings"] : "Plain"]" + H.dna.features["moth_wings"] = "[(H.client && H.client.prefs && LAZYLEN(H.client?.prefs?.features) && H.client?.prefs?.features["moth_wings"]) ? H.client?.prefs?.features["moth_wings"] : "Plain"]" handle_mutant_bodyparts(H) /datum/species/moth/random_name(gender,unique,lastname) diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index 51c7ad9d..3a863d70 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -25,7 +25,7 @@ log_whisper("[src.name]/[src.key] : [message]") if (src.client) - if (src.client.prefs.muted & MUTE_IC) + if (src.client?.prefs?.muted & MUTE_IC) to_chat(src, "You cannot whisper (muted).") return @@ -54,7 +54,7 @@ var/list/listening_dead = list() for(var/mob/M in GLOB.player_list) - if(M.stat == DEAD && M.client && ((M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER) || (get_dist(M, src) <= 7))) + if(M.stat == DEAD && M.client && ((M.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER) || (get_dist(M, src) <= 7))) listening_dead |= M var/list/listening = get_hearers_in_view(1, src) diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index 68464e5a..4a93a0e0 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -410,7 +410,7 @@ return FALSE else if(QDELETED(user)) return FALSE - else if(user.client && user.client.prefs.muted & MUTE_IC) + else if(user.client && user.client?.prefs?.muted & MUTE_IC) to_chat(user, "You cannot send IC messages (muted).") return FALSE else if(!params) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index cc3c1c32..d05a7766 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1105,7 +1105,7 @@ if(client) client.move_delay = world.time + movement_delay() lying_prev = lying - if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client.prefs.autostand)//CIT CHANGE - adds autostanding as a preference + if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client?.prefs?.autostand)//CIT CHANGE - adds autostanding as a preference addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto return canmove diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 7694e7f8..a440781b 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -249,7 +249,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( deaf_message = "You can't hear yourself!" deaf_type = 2 // Since you should be able to hear yourself without looking // Create map text prior to modifying message for goonchat - if (client?.prefs.chat_on_map && stat != UNCONSCIOUS && (client.prefs.see_chat_non_mob || ismob(speaker)) && can_hear()) + if (client?.prefs.chat_on_map && stat != UNCONSCIOUS && (client?.prefs?.see_chat_non_mob || ismob(speaker)) && can_hear()) create_chat_message(speaker, message_language, raw_message, spans, message_mode) if (client?.prefs.radiosounds && stat != UNCONSCIOUS && can_hear() && radio_freq) playsound_local(src,'sound/voice/radio.ogg', 30, 0) @@ -281,9 +281,9 @@ GLOBAL_LIST_INIT(department_radio_keys, list( if(!M.client || !client) //client is so that ghosts don't have to listen to mice continue if(get_dist(M, source) > 7 || M.z != z) //they're out of range of normal hearing - if(eavesdropping_modes[message_mode] && !(M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER)) //they're whispering and we have hearing whispers at any range off + if(eavesdropping_modes[message_mode] && !(M.client?.prefs?.chat_toggles & CHAT_GHOSTWHISPER)) //they're whispering and we have hearing whispers at any range off continue - if(!(M.client.prefs.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off + if(!(M.client?.prefs?.chat_toggles & CHAT_GHOSTEARS)) //they're talking normally and we have hearing at any range off continue listening |= M the_dead[M] = TRUE @@ -306,7 +306,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( //speech bubble var/list/speech_bubble_recipients = list() for(var/mob/M in listening) - if(M.client && !M.client.prefs.chat_on_map) + if(M.client && !M.client?.prefs?.chat_on_map) speech_bubble_recipients.Add(M.client) var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", FLY_LAYER) I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA @@ -321,7 +321,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( /mob/living/proc/can_speak_basic(message, ignore_spam = FALSE) //Check BEFORE handling of xeno and ling channels if(client) - if(client.prefs.muted & MUTE_IC) + if(client?.prefs?.muted & MUTE_IC) to_chat(src, "You cannot speak in IC (muted).") return 0 if(!ignore_spam && client.handle_spam_prevention(message,MUTE_IC)) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 8e7ebc06..a110ee55 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -830,7 +830,7 @@ jobpart = "Unknown" var/rendered = "[start][hrefpart][namepart] ([jobpart]) [treated_message]" - if (client?.prefs.chat_on_map && (client.prefs.see_chat_non_mob || ismob(speaker))) + if (client?.prefs.chat_on_map && (client?.prefs?.see_chat_non_mob || ismob(speaker))) create_chat_message(speaker, message_language, raw_message, spans, message_mode) show_message(rendered, MSG_AUDIBLE) diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm index 7668310d..09adac60 100644 --- a/code/modules/mob/living/silicon/ai/say.dm +++ b/code/modules/mob/living/silicon/ai/say.dm @@ -151,7 +151,7 @@ if(!only_listener) // Play voice for all mobs in the z level for(var/mob/M in GLOB.player_list) - if(M.client && M.can_hear() && (M.client.prefs.toggles & SOUND_ANNOUNCEMENTS)) + if(M.client && M.can_hear() && (M.client?.prefs?.toggles & SOUND_ANNOUNCEMENTS)) var/turf/T = get_turf(M) if(T.z == z_level) SEND_SOUND(M, voice) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 4a96c7ce..b47eed7b 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -13,7 +13,7 @@ create_mob_hud() if(hud_used) hud_used.show_hud(hud_used.hud_version) - hud_used.update_ui_style(ui_style2icon(client.prefs.UI_style)) + hud_used.update_ui_style(ui_style2icon(client?.prefs?.UI_style)) next_move = 1 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 16608681..9668f24a 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -488,11 +488,11 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA if(!ckey) return SEND_SIGNAL(new_mob, COMSIG_MOB_PRE_PLAYER_CHANGE, new_mob, src) - if (client && client.prefs && client.prefs.auto_ooc) - if (client.prefs.chat_toggles & CHAT_OOC && isliving(new_mob)) - client.prefs.chat_toggles ^= CHAT_OOC - if (!(client.prefs.chat_toggles & CHAT_OOC) && isdead(new_mob)) - client.prefs.chat_toggles ^= CHAT_OOC + if (client && client.prefs && client?.prefs?.auto_ooc) + if (client?.prefs?.chat_toggles & CHAT_OOC && isliving(new_mob)) + client?.prefs?.chat_toggles ^= CHAT_OOC + if (!(client?.prefs?.chat_toggles & CHAT_OOC) && isdead(new_mob)) + client?.prefs?.chat_toggles ^= CHAT_OOC new_mob.ckey = ckey new_mob.client?.init_verbs() if(send_signal) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index a03d5883..373fd3e2 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -401,8 +401,8 @@ It's fairly easy to fix if dealing with single letters but not so much with comp if(source) var/obj/screen/alert/notify_action/A = O.throw_alert("[REF(source)]_notify_action", /obj/screen/alert/notify_action) if(A) - if(O.client.prefs && O.client.prefs.UI_style) - A.icon = ui_style2icon(O.client.prefs.UI_style) + if(O.client.prefs && O.client?.prefs?.UI_style) + A.icon = ui_style2icon(O.client?.prefs?.UI_style) A.desc = message A.action = action A.target = source diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 8c7fc687..084bc9c5 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -90,7 +90,7 @@ if (src.client) - if(src.client.prefs.muted & MUTE_DEADCHAT) + if(src.client?.prefs?.muted & MUTE_DEADCHAT) to_chat(src, "You cannot talk in deadchat (muted).") return diff --git a/code/modules/mob/say_vr.dm b/code/modules/mob/say_vr.dm index 659de870..460eaacd 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -36,7 +36,7 @@ proc/get_top_level_mob(var/mob/S) if(jobban_isbanned(user, "emote")) to_chat(user, "You cannot send subtle emotes (banned).") return FALSE - else if(user.client && user.client.prefs.muted & MUTE_IC) + else if(user.client && user.client?.prefs?.muted & MUTE_IC) to_chat(user, "You cannot send IC messages (muted).") return FALSE else if(!params) @@ -69,7 +69,7 @@ proc/get_top_level_mob(var/mob/S) if(!M.client || isnewplayer(M)) continue var/T = get_turf(src) - if(M.stat == DEAD && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null))) + if(M.stat == DEAD && M.client && (M.client?.prefs?.chat_toggles & CHAT_GHOSTSIGHT) && !(M in viewers(T, null))) M.show_message(message) if(emote_type == EMOTE_AUDIBLE) @@ -100,7 +100,7 @@ proc/get_top_level_mob(var/mob/S) if(jobban_isbanned(user, "emote")) to_chat(user, "You cannot send subtle emotes (banned).") return FALSE - else if(user.client && user.client.prefs.muted & MUTE_IC) + else if(user.client && user.client?.prefs?.muted & MUTE_IC) to_chat(user, "You cannot send IC messages (muted).") return FALSE else if(!params) diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm index 55fe8f0b..62d834af 100644 --- a/code/modules/tgui/tgui.dm +++ b/code/modules/tgui/tgui.dm @@ -107,7 +107,7 @@ // Remove titlebar and resize handles for a fancy window var/have_title_bar - if(user.client.prefs.tgui_fancy) + if(user.client?.prefs?.tgui_fancy) have_title_bar = "titlebar=0;can_resize=0;" else have_title_bar = "titlebar=1;can_resize=1;" @@ -219,8 +219,8 @@ "screen" = ui_screen, "style" = style, "interface" = interface, - "fancy" = user.client.prefs.tgui_fancy, - "locked" = user.client.prefs.tgui_lock && !custom_browser_id, + "fancy" = user.client?.prefs?.tgui_fancy, + "locked" = user.client?.prefs?.tgui_lock && !custom_browser_id, "observer" = isobserver(user), "window" = window_id, // NOTE: Intentional \ref usage; tgui datums can't/shouldn't @@ -269,9 +269,9 @@ if("tgui:link") user << link(params["url"]) if("tgui:fancy") - user.client.prefs.tgui_fancy = TRUE + user.client?.prefs?.tgui_fancy = TRUE if("tgui:nofrills") - user.client.prefs.tgui_fancy = FALSE + user.client?.prefs?.tgui_fancy = FALSE else update_status(push = FALSE) // Update the window state. if(src_object.ui_act(action, params, src, state)) // Call ui_act() on the src_object. diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index ab7dc917..ef5baad9 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -108,8 +108,8 @@ Notes: /proc/openToolTip(mob/user = null, atom/movable/tip_src = null, params = null,title = "",content = "",theme = "") if(istype(user)) if(user.client && user.client.tooltips) - if(!theme && user.client.prefs && user.client.prefs.UI_style) - theme = lowertext(user.client.prefs.UI_style) + if(!theme && user.client.prefs && user.client?.prefs?.UI_style) + theme = lowertext(user.client?.prefs?.UI_style) if(!theme) theme = "default" user.client.tooltips.show(tip_src, params,title,content,theme) diff --git a/hyperstation/code/datums/weather/oxygen_rain.dm b/hyperstation/code/datums/weather/oxygen_rain.dm index 821e781b..1e6fcdc3 100644 --- a/hyperstation/code/datums/weather/oxygen_rain.dm +++ b/hyperstation/code/datums/weather/oxygen_rain.dm @@ -34,7 +34,7 @@ sender_override = "GATO Meteorology Division") for(var/V in GLOB.player_list) var/mob/M = V - if((M.client.prefs.toggles & SOUND_MIDI) && is_station_level(M.z)) + if((M.client?.prefs?.toggles & SOUND_MIDI) && is_station_level(M.z)) M.playsound_local(M, 'hyperstation/sound/ambience/embrace.ogg', 40, FALSE, pressure_affected = FALSE) /* "Sappheiros - Embrace" is under a Creative Commons license (CC BY 3.0) diff --git a/hyperstation/code/gamemode/traitor_lewd.dm b/hyperstation/code/gamemode/traitor_lewd.dm index 4de6a460..b3f9c1cb 100644 --- a/hyperstation/code/gamemode/traitor_lewd.dm +++ b/hyperstation/code/gamemode/traitor_lewd.dm @@ -128,7 +128,7 @@ GLOBAL_LIST_INIT(hyper_special_roles, list( candidates += applicant for(var/mob/living/carbon/human/target in GLOB.player_list) - if(target.client.prefs.noncon) + if(target.client?.prefs?.noncon) if(!(target.job in temp.restricted_jobs)) targets += target @@ -212,7 +212,7 @@ GLOBAL_LIST_INIT(hyper_special_roles, list( var/list/datum/mind/owners = get_owners() for(var/datum/mind/candidate in SSticker.minds) if (!(candidate in owners) && ishuman(candidate.current) && (candidate.current.client)) - if(candidate.current.client.prefs.noncon == 1) + if(candidate.current.client?.prefs?.noncon == 1) targets += candidate if(targets.len > 0) target = pick(targets) diff --git a/hyperstation/code/modules/antagonists/wendigo/datums_hud.dm b/hyperstation/code/modules/antagonists/wendigo/datums_hud.dm index ab6b6fda..9f8c1567 100644 --- a/hyperstation/code/modules/antagonists/wendigo/datums_hud.dm +++ b/hyperstation/code/modules/antagonists/wendigo/datums_hud.dm @@ -30,7 +30,7 @@ related to the antag that could be a datum var/obj/screen/inventory/inv_box var/widescreenlayout = FALSE //adds support for different hud layouts depending on widescreen pref - if(owner.client && owner.client.prefs && owner.client.prefs.widescreenpref) + if(owner.client && owner.client.prefs && owner.client?.prefs?.widescreenpref) widescreenlayout = FALSE //CRAFTING diff --git a/hyperstation/code/modules/mob/mob_helpers.dm b/hyperstation/code/modules/mob/mob_helpers.dm index 00f9c863..de5372ff 100644 --- a/hyperstation/code/modules/mob/mob_helpers.dm +++ b/hyperstation/code/modules/mob/mob_helpers.dm @@ -6,10 +6,10 @@ mob/proc/checkloadappearance() to_chat(H, "This ghost role allows you to select your loaded character's appearance. Make sure you have your ID in your ID slot, if you have one.") if(alert(H, "Would you like to load your currently loaded character's appearance?", "This can only be done up until 90s after you spawn.", "Yes", "No") == "Yes" && world.time <= (H.time_initialized + 900)) if(alert(H, "You should only load a character that has not currently died in the round. Do you accept this?", "Warning", "Yes", "No") == "Yes" && world.time <= (H.time_initialized + 900)) - H.client.prefs.copy_to(H) + H.client?.prefs?.copy_to(H) if (H.custom_body_size) //Do they have a custom size set? H.resize(H.custom_body_size * 0.01) - H.real_name = H.client.prefs.real_name + H.real_name = H.client?.prefs?.real_name H.mind.name = H.real_name //Makes sure to change their mind name to their real name. SSquirks.AssignQuirks(H, H.client, TRUE, FALSE, H.job, FALSE)//This Assigns the selected character's quirks H.dna.update_dna_identity() //This makes sure their DNA is updated. diff --git a/modular_citadel/code/controllers/subsystem/job.dm b/modular_citadel/code/controllers/subsystem/job.dm index 847ab18e..1c46ae2e 100644 --- a/modular_citadel/code/controllers/subsystem/job.dm +++ b/modular_citadel/code/controllers/subsystem/job.dm @@ -8,7 +8,7 @@ var/list/queued_to_equip = list() //Items that will equip onto the player . = list() //Items that will be stored into the player's backpack, handled by EquipRank() - for(var/i in the_mob.client.prefs.chosen_gear) //Prepare the player's loadout gear + for(var/i in the_mob.client?.prefs?.chosen_gear) //Prepare the player's loadout gear var/datum/gear/G = i G = GLOB.loadout_items[slot_to_string(initial(G.category))][initial(G.name)] if(!G) diff --git a/modular_citadel/code/datums/status_effects/chems.dm b/modular_citadel/code/datums/status_effects/chems.dm index 3474a465..b75a6ae7 100644 --- a/modular_citadel/code/datums/status_effects/chems.dm +++ b/modular_citadel/code/datums/status_effects/chems.dm @@ -180,8 +180,8 @@ set category = "IC" set name = "Toggle Lewdchem" set desc = "Allows you to toggle if you'd like lewd flavour messages." - client.prefs.lewdchem = !(client.prefs.lewdchem) - to_chat(usr, "You [(client.prefs.lewdchem?"will":"no longer")] receive lewdchem messages.") + client?.prefs?.lewdchem = !(client?.prefs?.lewdchem) + to_chat(usr, "You [(client?.prefs?.lewdchem?"will":"no longer")] receive lewdchem messages.") /datum/status_effect/chem/enthrall id = "enthrall" diff --git a/modular_citadel/code/game/objects/cit_screenshake.dm b/modular_citadel/code/game/objects/cit_screenshake.dm index 5bb1f82c..ed1db5cd 100644 --- a/modular_citadel/code/game/objects/cit_screenshake.dm +++ b/modular_citadel/code/game/objects/cit_screenshake.dm @@ -49,7 +49,7 @@ if(force >= 15) shake_camera(user, ((force - 10) * 0.01 + 1), ((force - 10) * 0.01)) if(M.client) - switch (M.client.prefs.damagescreenshake) + switch (M.client?.prefs?.damagescreenshake) if (1) shake_camera(M, ((force - 10) * 0.015 + 1), ((force - 10) * 0.015)) if (2) diff --git a/modular_citadel/code/modules/antagonists/cit_crewobjectives.dm b/modular_citadel/code/modules/antagonists/cit_crewobjectives.dm index a2f3e3b3..c1a4a8ce 100644 --- a/modular_citadel/code/modules/antagonists/cit_crewobjectives.dm +++ b/modular_citadel/code/modules/antagonists/cit_crewobjectives.dm @@ -1,6 +1,6 @@ /datum/controller/subsystem/ticker/proc/generate_crew_objectives() for(var/datum/mind/crewMind in SSticker.minds) - if(prob(5) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in crewMind.current.client.prefs.be_special) + if(prob(5) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in crewMind.current.client?.prefs?.be_special) generate_miscreant_objectives(crewMind) else if(CONFIG_GET(flag/allow_crew_objectives)) diff --git a/modular_citadel/code/modules/antagonists/cit_miscreants.dm b/modular_citadel/code/modules/antagonists/cit_miscreants.dm index 57261678..a99e1d29 100644 --- a/modular_citadel/code/modules/antagonists/cit_miscreants.dm +++ b/modular_citadel/code/modules/antagonists/cit_miscreants.dm @@ -7,7 +7,7 @@ return if(!crewMind.assigned_role) return - if(!(ROLE_MISCREANT in crewMind.current.client.prefs.be_special)) + if(!(ROLE_MISCREANT in crewMind.current.client?.prefs?.be_special)) return if(jobban_isbanned(crewMind, "Syndicate")) return diff --git a/modular_citadel/code/modules/client/preferences_toggles.dm b/modular_citadel/code/modules/client/preferences_toggles.dm index 9d91c09c..1bcc63b1 100644 --- a/modular_citadel/code/modules/client/preferences_toggles.dm +++ b/modular_citadel/code/modules/client/preferences_toggles.dm @@ -2,10 +2,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggleeatingnoise)() set name = "Toggle Eating Noises" set category = "Preferences" set desc = "Hear Eating noises" - usr.client.prefs.cit_toggles ^= EATING_NOISES - usr.client.prefs.save_preferences() + usr.client?.prefs?.cit_toggles ^= EATING_NOISES + usr.client?.prefs?.save_preferences() usr.stop_sound_channel(CHANNEL_PRED) - to_chat(usr, "You will [(usr.client.prefs.cit_toggles & EATING_NOISES) ? "now" : "no longer"] hear eating noises.") + to_chat(usr, "You will [(usr.client?.prefs?.cit_toggles & EATING_NOISES) ? "now" : "no longer"] hear eating noises.") /datum/verbs/menu/Settings/Sound/toggleeatingnoise/Get_checked(client/C) return C.prefs.cit_toggles & EATING_NOISES @@ -13,10 +13,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggledigestionnoise)() set name = "Toggle Digestion Noises" set category = "Preferences" set desc = "Hear digestive noises" - usr.client.prefs.cit_toggles ^= DIGESTION_NOISES - usr.client.prefs.save_preferences() + usr.client?.prefs?.cit_toggles ^= DIGESTION_NOISES + usr.client?.prefs?.save_preferences() usr.stop_sound_channel(CHANNEL_DIGEST) - to_chat(usr, "You will [(usr.client.prefs.cit_toggles & DIGESTION_NOISES) ? "now" : "no longer"] hear digestion noises.") + to_chat(usr, "You will [(usr.client?.prefs?.cit_toggles & DIGESTION_NOISES) ? "now" : "no longer"] hear digestion noises.") /datum/verbs/menu/Settings/Sound/toggledigestionnoise/Get_checked(client/C) return C.prefs.cit_toggles & DIGESTION_NOISES @@ -24,10 +24,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, toggleburpingnoise)() set name = "Toggle Burping Noises" set category = "Preferences" set desc = "Hear Burping noises" - usr.client.prefs.cit_toggles ^= BURPING_NOISES - usr.client.prefs.save_preferences() + usr.client?.prefs?.cit_toggles ^= BURPING_NOISES + usr.client?.prefs?.save_preferences() usr.stop_sound_channel(CHANNEL_BURP) - to_chat(usr, "You will [(usr.client.prefs.cit_toggles & BURPING_NOISES) ? "now" : "no longer"] hear burping noises.") + to_chat(usr, "You will [(usr.client?.prefs?.cit_toggles & BURPING_NOISES) ? "now" : "no longer"] hear burping noises.") /datum/verbs/menu/Settings/Sound/toggleburpingnoise/Get_checked(client/C) return C.prefs.cit_toggles & BURPING_NOISES @@ -35,10 +35,10 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglefartingnoise)() set name = "Toggle Farting Noises" set category = "Preferences" set desc = "Hear Farting noises" - usr.client.prefs.cit_toggles ^= FARTING_NOISES - usr.client.prefs.save_preferences() + usr.client?.prefs?.cit_toggles ^= FARTING_NOISES + usr.client?.prefs?.save_preferences() usr.stop_sound_channel(CHANNEL_FART) - to_chat(usr, "You will [(usr.client.prefs.cit_toggles & FARTING_NOISES) ? "now" : "no longer"] hear farting noises.") + to_chat(usr, "You will [(usr.client?.prefs?.cit_toggles & FARTING_NOISES) ? "now" : "no longer"] hear farting noises.") /datum/verbs/menu/Settings/Sound/togglefartingnoise/Get_checked(client/C) return C.prefs.cit_toggles & FARTING_NOISES @@ -46,12 +46,12 @@ TOGGLE_CHECKBOX(/datum/verbs/menu/Settings/Sound, togglehoundsleeper)() set name = "Toggle Voracious Hound Sleepers" set category = "Preferences" set desc = "Toggles Voracious MediHound Sleepers" - usr.client.prefs.cit_toggles ^= MEDIHOUND_SLEEPER - usr.client.prefs.save_preferences() - if(usr.client.prefs.cit_toggles & MEDIHOUND_SLEEPER) + usr.client?.prefs?.cit_toggles ^= MEDIHOUND_SLEEPER + usr.client?.prefs?.save_preferences() + if(usr.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER) to_chat(usr, "You have opted in for voracious medihound sleepers.") else to_chat(usr, "Medihound sleepers will no longer be voracious when you're involved.") - SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle MediHound Sleeper", "[usr.client.prefs.cit_toggles & MEDIHOUND_SLEEPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.record_feedback("nested tally", "preferences_verb", 1, list("Toggle MediHound Sleeper", "[usr.client?.prefs?.cit_toggles & MEDIHOUND_SLEEPER ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/verbs/menu/Settings/Sound/togglehoundsleeper/Get_checked(client/C) return C.prefs.cit_toggles & MEDIHOUND_SLEEPER diff --git a/modular_citadel/code/modules/mob/living/living.dm b/modular_citadel/code/modules/mob/living/living.dm index b74d116c..c294a153 100644 --- a/modular_citadel/code/modules/mob/living/living.dm +++ b/modular_citadel/code/modules/mob/living/living.dm @@ -51,7 +51,7 @@ set name = "Rest" set category = "IC" - if(client && client.prefs && client.prefs.autostand) + if(client && client.prefs && client?.prefs?.autostand) intentionalresting = !intentionalresting to_chat(src, "You are now attempting to [intentionalresting ? "[!resting ? "lay down and ": ""]stay down" : "[resting ? "get up and ": ""]stay up"].") if(intentionalresting && !resting) @@ -132,4 +132,4 @@ /mob/living/proc/update_hud_sprint_bar() if(hud_used && hud_used.sprint_buffer) hud_used.sprint_buffer.update_to_mob(src) -*/ \ No newline at end of file +*/ diff --git a/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm b/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm index f2228b4d..f39e12d1 100644 --- a/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm +++ b/modular_citadel/code/modules/vore/eating/belly_obj_vr.dm @@ -174,7 +174,7 @@ var/turf/source = get_turf(owner) var/sound/eating = sound(GLOB.vore_sounds[vore_sound]) for(var/mob/living/M in get_hearers_in_view(3, source)) - if(M.client && M.client.prefs.cit_toggles & EATING_NOISES) + if(M.client && M.client?.prefs?.cit_toggles & EATING_NOISES) M.playsound_local(source, vore_sound, 50, 1, S = eating) recent_sound = (world.time + 20 SECONDS) @@ -214,7 +214,7 @@ var/turf/source = get_turf(owner) var/sound/releasement = sound(GLOB.release_sounds[release_sound]) for(var/mob/living/M in get_hearers_in_view(2, source)) - if(M.client && (M.client.prefs.cit_toggles & EATING_NOISES)) + if(M.client && (M.client?.prefs?.cit_toggles & EATING_NOISES)) M.playsound_local(source, release_sound, 50, 1, S = releasement) //Clean up our own business @@ -242,7 +242,7 @@ var/turf/source = get_turf(owner) var/sound/releasement = sound(GLOB.release_sounds[release_sound]) for(var/mob/living/H in get_hearers_in_view(2, source)) - if(H.client && (H.client.prefs.cit_toggles & EATING_NOISES)) + if(H.client && (H.client?.prefs?.cit_toggles & EATING_NOISES)) H.playsound_local(source, release_sound, 50, 1, S = releasement) if(istype(M,/mob/living)) @@ -323,7 +323,7 @@ var/turf/source = get_turf(owner) var/sound/eating = sound(GLOB.vore_sounds[vore_sound]) for(var/mob/living/M in get_hearers_in_view(3, source)) - if(M.client && M.client.prefs.cit_toggles & EATING_NOISES) + if(M.client && M.client?.prefs?.cit_toggles & EATING_NOISES) M.playsound_local(source, vore_sound, 50, 1, S = eating) owner.updateVRPanel() @@ -535,17 +535,17 @@ if(is_wet) for(var/mob/living/M in get_hearers_in_view(3, source)) - if(M.client && M.client.prefs.cit_toggles & EATING_NOISES) + if(M.client && M.client?.prefs?.cit_toggles & EATING_NOISES) M.playsound_local(source, "struggle_sound", 50, 1, S = struggle_snuggle) else for(var/mob/living/M in get_hearers_in_view(3, source)) - if(M.client && M.client.prefs.cit_toggles & EATING_NOISES) + if(M.client && M.client?.prefs?.cit_toggles & EATING_NOISES) M.playsound_local(source, "rustle", 50, 1, S = struggle_rustle) var/list/watching = hearers(3, owner) for(var/mob/living/M in watching) - if(M.client && (M.client.prefs.cit_toggles & EATING_NOISES)) //Might as well censor the normies here too. + if(M.client && (M.client?.prefs?.cit_toggles & EATING_NOISES)) //Might as well censor the normies here too. M.show_message(struggle_outer_message, MSG_VISUAL) // visible to_chat(R,struggle_user_message) diff --git a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm index b812ad7a..c85bc940 100644 --- a/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm +++ b/modular_citadel/code/modules/vore/eating/bellymodes_vr.dm @@ -35,7 +35,7 @@ if(!M.client) continue M.stop_sound_channel(CHANNEL_PREYLOOP) // sanity just in case - if(M.client.prefs.cit_toggles & DIGESTION_NOISES) + if(M.client?.prefs?.cit_toggles & DIGESTION_NOISES) var/sound/preyloop = sound('sound/vore/prey/loop.ogg', repeat = TRUE) M.playsound_local(get_turf(src),preyloop, 80,0, channel = CHANNEL_PREYLOOP) M.next_preyloop = (world.time + 52 SECONDS) @@ -73,7 +73,7 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/living/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time @@ -121,7 +121,7 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/living/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time @@ -156,7 +156,7 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/living/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time @@ -180,7 +180,7 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/living/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time @@ -200,7 +200,7 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/living/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time @@ -242,7 +242,7 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/living/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time @@ -275,7 +275,7 @@ if((world.time - NORMIE_HEARCHECK) > last_hearcheck) LAZYCLEARLIST(hearing_mobs) for(var/mob/living/H in get_hearers_in_view(3, source)) - if(!H.client || !(H.client.prefs.cit_toggles & DIGESTION_NOISES)) + if(!H.client || !(H.client?.prefs?.cit_toggles & DIGESTION_NOISES)) continue LAZYADD(hearing_mobs, H) last_hearcheck = world.time diff --git a/modular_citadel/code/modules/vore/eating/vore_vr.dm b/modular_citadel/code/modules/vore/eating/vore_vr.dm index 992eb632..52efb8fa 100644 --- a/modular_citadel/code/modules/vore/eating/vore_vr.dm +++ b/modular_citadel/code/modules/vore/eating/vore_vr.dm @@ -85,10 +85,10 @@ GLOBAL_LIST_EMPTY(vore_preferences_datums) /datum/vore_preferences/proc/load_vore() if(!client || !client_ckey) return 0 //No client, how can we save? - if(!client.prefs || !client.prefs.default_slot) + if(!client.prefs || !client?.prefs?.default_slot) return 0 //Need to know what character to load! - slot = client.prefs.default_slot + slot = client?.prefs?.default_slot load_path(client_ckey,slot)