From 68af96b5a67b3deb3ce7d66c5eb586c8319c4e3d Mon Sep 17 00:00:00 2001 From: Heroman Date: Mon, 4 Jul 2022 16:00:39 +1000 Subject: [PATCH] Fixes speech bubble appearing on blank messages --- code/modules/mob/hear_say.dm | 6 ++++-- code/modules/mob/living/say.dm | 20 +++++++++---------- .../nifsoft/software/13_soulcatcher.dm | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 54a86d9b28..797918d0f8 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -92,7 +92,7 @@ var/list/combined = combine_message(message_pieces, verb, speaker) var/message = combined["formatted"] if(message == "") - return + return FALSE if(sleeping || stat == UNCONSCIOUS) hear_sleep(multilingual_to_message(message_pieces)) @@ -129,9 +129,11 @@ var/turf/source = speaker ? get_turf(speaker) : get_turf(src) playsound_local(source, speech_sound, sound_vol, 1) + return TRUE + // Done here instead of on_hear_say() since that is NOT called if the mob is clientless (which includes most AI mobs). /mob/living/hear_say(var/list/message_pieces, var/verb = "says", var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol) - ..() + .=..() if(has_AI()) // Won't happen if no ai_holder exists or there's a player inside w/o autopilot active. ai_holder.on_hear_say(speaker, multilingual_to_message(message_pieces)) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 84b825b644..4afbd885fc 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -361,18 +361,18 @@ var/list/channel_to_radio_key = new var/runechat_enabled = M.client?.is_preference_enabled(/datum/client_preference/runechat_mob) if(dst <= message_range || (M.stat == DEAD && !forbid_seeing_deadchat)) //Inside normal message range, or dead with ears (handled in the view proc) - if(M.client && !runechat_enabled) - var/image/I1 = listening[M] || speech_bubble - images_to_clients[I1] |= M.client - M << I1 - M.hear_say(message_pieces, verb, italics, src, speech_sound, sound_vol) + if(M.hear_say(message_pieces, verb, italics, src, speech_sound, sound_vol)) + if(M.client && !runechat_enabled) + var/image/I1 = listening[M] || speech_bubble + images_to_clients[I1] |= M.client + M << I1 if(whispering && !isobserver(M)) //Don't even bother with these unless whispering if(dst > message_range && dst <= w_scramble_range) //Inside whisper scramble range - if(M.client && !runechat_enabled) - var/image/I2 = listening[M] || speech_bubble - images_to_clients[I2] |= M.client - M << I2 - M.hear_say(stars_all(message_pieces), verb, italics, src, speech_sound, sound_vol*0.2) + if(M.hear_say(stars_all(message_pieces), verb, italics, src, speech_sound, sound_vol*0.2)) + if(M.client && !runechat_enabled) + var/image/I2 = listening[M] || speech_bubble + images_to_clients[I2] |= M.client + M << I2 if(dst > w_scramble_range && dst <= world.view) //Inside whisper 'visible' range M.show_message("[name] [w_not_heard].", 2) diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index d92e646660..a8f66619a6 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -326,7 +326,7 @@ /mob/living/carbon/brain/caught_soul/hear_say() if(ext_deaf || !client) return FALSE - ..() + .=..() /mob/living/carbon/brain/caught_soul/show_message(msg, type, alt, alt_type) if(ext_blind || !client)