From 672be37da571684e65dbd9439f1595bf1ccc2ac2 Mon Sep 17 00:00:00 2001 From: Cthulhu80 <122310258+Cthulhu80@users.noreply.github.com> Date: Sat, 30 Dec 2023 22:01:20 -0800 Subject: [PATCH] Fixes mobs in crit being able to understand other languages (#5342) # About the pull request Fixes #3778 , mobs should no longer be able to comprehend other languages while in crit. # Explain why it's good for the game bug bad # Changelog :cl: fix: Fixes mobs being able to understand other languages while in crit. /:cl: --- code/modules/mob/hear_say.dm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index c66d096c6c68..dd71180e2dfe 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -202,18 +202,21 @@ /mob/living/hear_say(message, verb, datum/language/language, alt_name, italics, mob/speaker, sound/speech_sound, sound_vol) if(client && mind && stat == UNCONSCIOUS) - hear_sleep(src, message, src == speaker, Adjacent(speaker)) + hear_sleep(speaker, message, src == speaker, Adjacent(speaker), language) return return ..() /mob/living/hear_radio(message, verb, datum/language/language, part_a, part_b, mob/speaker, hard_to_hear, vname, command, no_paygrade) if(client && mind && stat == UNCONSCIOUS) - hear_sleep(src, message, FALSE, FALSE) + hear_sleep(speaker, message, FALSE, FALSE, language) return return ..() -/mob/living/proc/hear_sleep(mob/speaker = null, message, hearing_self = FALSE, proximity_flag = FALSE) +/mob/living/proc/hear_sleep(mob/speaker = null, message, hearing_self = FALSE, proximity_flag = FALSE, datum/language/language = null) var/heard = "" + var/clear_char_probability = 90 + if(!say_understands(speaker, language)) + clear_char_probability = 25 if(sdisabilities & DISABILITY_DEAF || ear_deaf) if(speaker == src) @@ -226,7 +229,7 @@ heard = SPAN_LOCALSAY("You mutter something about... [stars(message, clear_char_probability = 99)]") else if(!sleeping && proximity_flag) - heard = SPAN_LOCALSAY("You hear someone near you say something... [stars(message, clear_char_probability = 90)]") + heard = SPAN_LOCALSAY("You hear someone near you say something... [stars(message, clear_char_probability)]") else if(prob(15))