Add null checks to client prefs checks

client.prefs. -> client?.prefs?.
This commit is contained in:
psq95
2023-05-13 23:53:47 +01:00
parent dfeb85bfa4
commit 5840c8ab99
93 changed files with 310 additions and 310 deletions
+1 -1
View File
@@ -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!
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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, "<span class='danger'>You cannot pray (muted).</span>")
return
if(src.client.handle_spam_prevention(msg,MUTE_PRAY))
+1 -1
View File
@@ -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