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
@@ -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)
+1 -1
View File
@@ -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