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
@@ -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
+2 -2
View File
@@ -6,10 +6,10 @@ mob/proc/checkloadappearance()
to_chat(H, "<span class='boldannounce'>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.</span>")
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.