From 3b73ae6283310a6d12ba35e36b363cb5fd30f65f Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Wed, 28 Jun 2023 18:22:29 -0400 Subject: [PATCH] Way better way to handle this --- code/modules/character_traits/biology_traits.dm | 2 ++ code/modules/mob/living/carbon/human/say.dm | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/character_traits/biology_traits.dm b/code/modules/character_traits/biology_traits.dm index e7625c391b75..d8158fe14b93 100644 --- a/code/modules/character_traits/biology_traits.dm +++ b/code/modules/character_traits/biology_traits.dm @@ -59,11 +59,13 @@ return ADD_TRAIT(target, TRAIT_LISPING, TRAIT_SOURCE_QUIRK) + target.speech_problem_flag = 1 ..() /datum/character_trait/biology/lisp/unapply_trait(mob/living/carbon/human/target) REMOVE_TRAIT(target, TRAIT_LISPING, TRAIT_SOURCE_QUIRK) + target.speech_problem_flag = 0 ..() /datum/character_trait/biology/bad_leg diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 2a070d69323e..41cd57504a71 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -115,7 +115,7 @@ message = capitalize(trim(message)) message = process_chat_markup(message, list("~", "_")) - if(speech_problem_flag) + if(speech_problem_flag) //this will be called later if used for radio, we have to call it later due to shitcode in radio var/list/handle_r = handle_speech_problems(message) message = handle_r[1] verb = handle_r[2] @@ -173,9 +173,6 @@ INVOKE_ASYNC(src, TYPE_PROC_REF(/mob/living/carbon/human, say_to_radios), used_radios, message, message_mode, verb, speaking) /mob/living/carbon/human/proc/say_to_radios(used_radios, message, message_mode, verb, speaking) - var/list/handle_r = handle_speech_problems(message) - message = handle_r[1] - verb = handle_r[2] for(var/obj/item/device/radio/R in used_radios) R.talk_into(src, message, message_mode, verb, speaking) @@ -304,6 +301,7 @@ for it but just ignore it. message = uppertext(message) verb = pick("yells like an idiot","says rather loudly") if(HAS_TRAIT(src, TRAIT_LISPING)) + handled = 1 var/old_message = message message = lisp_replace(message) if(old_message != message)