[MIRROR] Fixes mecha speech indicators never going away [MDB IGNORE] (#19520)

* Fixes mecha speech indicators never going away (#73617)

## About The Pull Request

Mecha speech indicators mistakenly passed ALL hearers in view to
`flick_overlay_global`, rather than just mobs with clients, so it
runtimed when it meant to disappear.

I also added some client sanity to the associated procs... I'm not sure
if they're needed but it seems like they'd be valuable there?

## Changelog

🆑 Melbert
fix: Mecha speech indicators actually go away
/🆑

* Fixes mecha speech indicators never going away

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-03-10 02:41:42 +00:00
committed by GitHub
co-authored by MrMelbert
parent a993ba2461
commit 4e9a254b35
2 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -127,7 +127,7 @@
/// Like add_image_to_client, but will add the image from a list of clients
/proc/add_image_to_clients(image/image_to_remove, list/show_to)
for(var/client/add_to as anything in show_to)
for(var/client/add_to in show_to)
add_to.images += image_to_remove
/// Removes an image from a client's `.images`. Useful as a callback.
@@ -136,7 +136,7 @@
/// Like remove_image_from_client, but will remove the image from a list of clients
/proc/remove_image_from_clients(image/image_to_remove, list/hide_from)
for(var/client/remove_from as anything in hide_from)
for(var/client/remove_from in hide_from)
remove_from.images -= image_to_remove
+7 -5
View File
@@ -676,11 +676,13 @@
///Displays a special speech bubble when someone inside the mecha speaks
/obj/vehicle/sealed/mecha/proc/display_speech_bubble(datum/source, list/speech_args)
SIGNAL_HANDLER
var/list/speech_bubble_recipients = get_hearers_in_view(7,src)
for(var/mob/M in speech_bubble_recipients)
if(M.client)
speech_bubble_recipients.Add(M.client)
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(flick_overlay_global), image('icons/mob/effects/talk.dmi', src, "machine[say_test(speech_args[SPEECH_MESSAGE])]",MOB_LAYER+1), speech_bubble_recipients, 30)
var/list/speech_bubble_recipients = list()
for(var/mob/listener in get_hearers_in_view(7, src))
if(listener.client)
speech_bubble_recipients += listener.client
var/image/mech_speech = image('icons/mob/effects/talk.dmi', src, "machine[say_test(speech_args[SPEECH_MESSAGE])]",MOB_LAYER+1)
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(flick_overlay_global), mech_speech, speech_bubble_recipients, 3 SECONDS)
/////////////////////////