PDA Messages are once again shown to non-observing dead mobs (#77750)

Current implementation uses isobserver for checking if we should send to
the player but dead players (who are still in their body) are not
observers and will fail that check.
This commit is contained in:
Zephyr
2023-08-21 21:17:43 -04:00
committed by GitHub
parent ea3ea6c7a3
commit 3923814194
3 changed files with 18 additions and 12 deletions
@@ -608,10 +608,11 @@
// Show it to ghosts
var/ghost_message = span_game_say("[span_name("[sender]")] [rigged ? "(as [span_name(fake_name)]) Rigged " : ""]PDA Message --> [span_name("[signal.format_target()]")]: \"[signal.format_message()]\"")
var/list/ghosts = GLOB.dead_player_list + GLOB.current_observers_list
for(var/mob/player_mob as anything in ghosts)
if(isobserver(player_mob) && (get_chat_toggles(player_mob.client) & CHAT_GHOSTPDA))
to_chat(player_mob, "[FOLLOW_LINK(player_mob, sender)] [ghost_message]")
var/list/message_listeners = GLOB.dead_player_list + GLOB.current_observers_list
for(var/mob/listener as anything in message_listeners)
if(!(get_chat_toggles(listener) & CHAT_GHOSTPDA))
continue
to_chat(listener, "[FOLLOW_LINK(listener, sender)] [ghost_message]")
to_chat(sender, span_info("PDA message sent to [signal.format_target()]: \"[message]\""))