Skip to content

Commit

Permalink
Way better way to handle this
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben10083 committed Jun 28, 2023
1 parent b8c42d2 commit 3b73ae6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions code/modules/character_traits/biology_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions code/modules/mob/living/carbon/human/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3b73ae6

Please sign in to comment.