Removes unneeded client checks on GLOB.player_list contents (#46445)

About The Pull Request

All mobs in GLOB.player_list have clients attached and there is in fact a fair amount of code that is working fine without checking client on things in player_list. This pr just removes a bunch of checks for client when iterating over player_list.
This commit is contained in:
spookydonut
2019-09-16 16:48:50 +12:00
committed by oranges
parent f764a3934a
commit 62b3fffe3b
20 changed files with 59 additions and 69 deletions
+1 -1
View File
@@ -350,7 +350,7 @@
for(var/mob/living/H in GLOB.player_list)
if(!(ishuman(H)||istype(H, /mob/living/silicon/)))
continue
if(H.stat == DEAD || !H.client || !H.mind || ispAI(H))
if(H.stat == DEAD || !H.mind || ispAI(H))
continue
if(is_special_character(H))
continue
+1 -1
View File
@@ -29,7 +29,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.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!
+1 -1
View File
@@ -13,7 +13,7 @@ GLOBAL_VAR_INIT(highlander, FALSE)
component.relocate() //Gets it out of bags and such
for(var/mob/living/carbon/human/H in GLOB.player_list)
if(H.stat == DEAD || !(H.client))
if(H.stat == DEAD)
continue
H.make_scottish()
+4 -5
View File
@@ -155,9 +155,8 @@
log_admin("[key_name(src)] stopped all currently playing sounds.")
message_admins("[key_name_admin(src)] stopped all currently playing sounds.")
for(var/mob/M in GLOB.player_list)
if(M.client)
SEND_SOUND(M, sound(null))
var/client/C = M.client
if(C && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
C.chatOutput.stopMusic()
SEND_SOUND(M, sound(null))
var/client/C = M.client
if(C && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
C.chatOutput.stopMusic()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Stop All Playing Sounds") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!