mirror of
https://github.com/KabKebab/GS13.git
synced 2026-08-23 04:56:23 +01:00
Add null checks to client prefs checks
client.prefs. -> client?.prefs?.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -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 += "</center>"
|
||||
|
||||
@@ -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)
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user