stops dchat clog from clientless mobs (#60772)

bug fix, because obviously the user.client check in the emote proc was supposed to work for this, but they forgot to put it in manual_emote as well.
also moved the user.client check in the emote proc a few lines above, for sliiiightly better performance, ghosts will still get the message from visible_message, but only if nearby, so it has the same effect as where it was before.
This commit is contained in:
Seris02
2021-08-12 02:54:48 -03:00
committed by GitHub
parent 091a16023d
commit ddac27ccc5
+12 -10
View File
@@ -114,11 +114,12 @@
playsound(user, tmp_sound, 50, vary)
var/user_turf = get_turf(user)
for(var/mob/ghost in GLOB.dead_mob_list)
if(!ghost.client || isnewplayer(ghost))
continue
if(ghost.stat == DEAD && ghost.client && user.client && (ghost.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(ghost in viewers(user_turf, null)))
ghost.show_message("<span class='emote'>[FOLLOW_LINK(ghost, user)] [dchatmsg]</span>")
if (user.client)
for(var/mob/ghost as anything in GLOB.dead_mob_list)
if(!ghost.client || isnewplayer(ghost))
continue
if(ghost.client.prefs.chat_toggles & CHAT_GHOSTSIGHT && !(ghost in viewers(user_turf, null)))
ghost.show_message("<span class='emote'>[FOLLOW_LINK(ghost, user)] [dchatmsg]</span>")
if(emote_type == EMOTE_AUDIBLE)
user.audible_message(msg, deaf_message = "<span class='emote'>You see how <b>[user]</b> [msg]</span>", audible_message_flags = EMOTE_MESSAGE)
@@ -283,10 +284,11 @@
var/ghost_text = "<b>[src]</b> [text]"
var/origin_turf = get_turf(src)
for(var/mob/ghost in GLOB.dead_mob_list)
if(!ghost.client || isnewplayer(ghost))
continue
if(ghost.stat == DEAD && ghost.client && (ghost.client.prefs.chat_toggles & CHAT_GHOSTSIGHT) && !(ghost in viewers(origin_turf, null)))
ghost.show_message("[FOLLOW_LINK(ghost, src)] [ghost_text]")
if(client)
for(var/mob/ghost as anything in GLOB.dead_mob_list)
if(!ghost.client || isnewplayer(ghost))
continue
if(ghost.client.prefs.chat_toggles & CHAT_GHOSTSIGHT && !(ghost in viewers(origin_turf, null)))
ghost.show_message("[FOLLOW_LINK(ghost, src)] [ghost_text]")
visible_message(text, visible_message_flags = EMOTE_MESSAGE)