diff --git a/code/game/machinery/tcomms/nttc.dm b/code/game/machinery/tcomms/nttc.dm index 8f53c135c44..4a1f63ec6f7 100644 --- a/code/game/machinery/tcomms/nttc.dm +++ b/code/game/machinery/tcomms/nttc.dm @@ -257,6 +257,7 @@ else job_class = all_jobs[rank] + tcm.pre_modify_name = tcm.sender_name if(toggle_name_color) var/new_name = "[tcm.sender_name]" tcm.sender_name = new_name diff --git a/code/game/machinery/tcomms/tcomms_base.dm b/code/game/machinery/tcomms/tcomms_base.dm index eca0cc7eed5..76fd96dc17e 100644 --- a/code/game/machinery/tcomms/tcomms_base.dm +++ b/code/game/machinery/tcomms/tcomms_base.dm @@ -204,6 +204,8 @@ GLOBAL_LIST_EMPTY(tcomms_machines) var/reject = FALSE /// Voice name if the person doesnt have a name (diona, alien, etc) var/vname + /// sender_name before modify_message modifies it, because it introduces html tags. + var/pre_modify_name /// List of all channels this can be sent or recieved on var/list/zlevels = list() /// Should this signal be re-broadcasted (Can be modified by NTTC, defaults to TRUE) @@ -382,21 +384,21 @@ GLOBAL_LIST_EMPTY(tcomms_machines) if(length(heard_masked)) for(var/M in heard_masked) var/mob/R = M - R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender, 0, tcm.sender_name, follow_target=tcm.follow_target) + R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender, FALSE, tcm.sender_name, follow_target=tcm.follow_target, check_name_against = tcm.pre_modify_name) /* --- Process all the mobs that heard the voice normally (understood) --- */ if(length(heard_normal)) for(var/M in heard_normal) var/mob/R = M - R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender, 0, tcm.sender_name, follow_target=tcm.follow_target) + R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender, FALSE, tcm.sender_name, follow_target=tcm.follow_target, check_name_against = tcm.pre_modify_name) /* --- Process all the mobs that heard the voice normally (did not understand) --- */ if(length(heard_voice)) for(var/M in heard_voice) var/mob/R = M - R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender,0, tcm.vname, follow_target=tcm.follow_target) + R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender, FALSE, tcm.vname, follow_target=tcm.follow_target, check_name_against = tcm.pre_modify_name) /* --- Process all the mobs that heard a garbled voice (did not understand) --- */ // Displays garbled message (ie "f*c* **u, **i*er!") @@ -404,7 +406,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines) if(length(heard_garbled)) for(var/M in heard_garbled) var/mob/R = M - R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender, 1, tcm.vname, follow_target=tcm.follow_target) + R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender, TRUE, tcm.vname, follow_target=tcm.follow_target, check_name_against = tcm.pre_modify_name) /* --- Complete gibberish. Usually happens when there's a compressed message --- */ @@ -412,7 +414,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines) if(length(heard_gibberish)) for(var/M in heard_gibberish) var/mob/R = M - R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender, 1, follow_target=tcm.follow_target) + R.hear_radio(tcm.message_pieces, tcm.verbage, part_a, part_b, tcm.sender, TRUE, follow_target=tcm.follow_target, check_name_against = tcm.pre_modify_name) return TRUE diff --git a/code/modules/mob/dead/observer/observer_say.dm b/code/modules/mob/dead/observer/observer_say.dm index ac39b557db0..a9f4ccef6c2 100644 --- a/code/modules/mob/dead/observer/observer_say.dm +++ b/code/modules/mob/dead/observer/observer_say.dm @@ -9,8 +9,16 @@ /mob/dead/observer/handle_track(message, verb = "says", mob/speaker = null, speaker_name, atom/follow_target, hard_to_hear) return "[speaker_name] ([ghost_follow_link(follow_target, ghost=src)])" -/mob/dead/observer/handle_speaker_name(mob/speaker = null, vname, hard_to_hear) +/mob/dead/observer/handle_speaker_name(mob/speaker = null, vname, hard_to_hear, check_name_against) var/speaker_name = ..() - if(speaker && (speaker_name != speaker.real_name) && !isAI(speaker) && !isAutoAnnouncer(speaker)) //Announce computer and various stuff that broadcasts doesn't use it's real name but AI's can't pretend to be other mobs. - speaker_name = "[speaker.real_name] ([speaker_name])" + if(!speaker) + return speaker_name + //Announce computer and various stuff that broadcasts doesn't use it's real name but AI's can't pretend to be other mobs. + if(isAI(speaker) || isAutoAnnouncer(speaker)) + return speaker_name + if(!check_name_against) + check_name_against = speaker_name + if(check_name_against == speaker.real_name) + return speaker_name + speaker_name = "[speaker.real_name] ([speaker_name])" return speaker_name diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index d8453a38f01..361163f4df7 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -121,7 +121,7 @@ playsound_local(source, speech_sound, sound_vol, 1, sound_frequency) -/mob/proc/hear_radio(list/message_pieces, verb = "says", part_a, part_b, mob/speaker = null, hard_to_hear = 0, vname = "", atom/follow_target, radio_freq) +/mob/proc/hear_radio(list/message_pieces, verb = "says", part_a, part_b, mob/speaker = null, hard_to_hear = 0, vname = "", atom/follow_target, check_name_against) if(!client) return @@ -137,7 +137,7 @@ if(!follow_target) follow_target = speaker - var/speaker_name = handle_speaker_name(speaker, vname, hard_to_hear) + var/speaker_name = handle_speaker_name(speaker, vname, hard_to_hear, check_name_against) track = handle_track(message, verb, speaker, speaker_name, follow_target, hard_to_hear) if(!can_hear()) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index c532475d841..042e9de5319 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -731,7 +731,7 @@ parrot_hear(html_decode(multilingual_to_message(message_pieces))) ..() -/mob/living/simple_animal/parrot/hear_radio(list/message_pieces, verb = "says", part_a, part_b, mob/speaker = null, hard_to_hear = 0, atom/follow_target) +/mob/living/simple_animal/parrot/hear_radio(list/message_pieces, verb = "says", part_a, part_b, mob/speaker = null, hard_to_hear = 0, atom/follow_target, check_name_against) if(speaker != src && prob(50)) parrot_hear(html_decode(multilingual_to_message(message_pieces))) ..()