Skip to content

Commit be98ab4

Browse files
authored
Language refactor & Blindness stuffs (#893)
* base stuff * tweaks to sign language not understood * stop hearing sign language * remove low memoery mode * fix compile error * fix null lang * fix random language setting * fixes * fix, this should be null not zero * fix zebra table css * language pref * Add Spacer * remove ssd indicator, touch up examine * adjust age positioning in examine * fixup species data usage * Partially hear people talking while unconscious * blindness * HOLY FUCK * fuck * fixes * more fixes * this probably fixes it...? * WORK!!!! * this probably needs infinity too * OOGA BOOGA PASS UNIT TESTS * fixes stuff * fix holopad range * fix this probably * before_speaking & say mod fixes * good enough * fix auto punctuation pref * dont modify payroll announcements * cleanup sign language saymod * cleaner * tanks are bulky
1 parent 8b05775 commit be98ab4

File tree

137 files changed

+1443
-987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+1443
-987
lines changed

code/__DEFINES/DNA.dm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ GLOBAL_LIST_INIT(organ_process_order, list(
216216
ORGAN_SLOT_XENO_EGGSAC,
217217
ORGAN_SLOT_BRAIN))
218218

219+
#define SPECIES_DATA_PERKS 1
220+
#define SPECIES_DATA_LANGUAGES 2
221+
219222
// Defines for used in creating "perks" for the species preference pages.
220223
/// A key that designates UI icon displayed on the perk.
221224
#define SPECIES_PERK_ICON "ui_icon"

code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@
5555
#define HEARING_SPEAKER 2
5656
#define HEARING_LANGUAGE 3
5757
#define HEARING_RAW_MESSAGE 4
58-
/* #define HEARING_RADIO_FREQ 5
58+
#define HEARING_RADIO_FREQ 5
5959
#define HEARING_SPANS 6
60-
#define HEARING_MESSAGE_MODE 7 */
60+
#define HEARING_MESSAGE_MODE 7
61+
#define HEARING_SOUND_LOC 8
62+
#define HEARING_MESSAGE_RANGE 9
63+
64+
/// Same as the above but RAW_MESSAGE will be replaced with the mob's interpretation of the message.
65+
#define COMSIG_LIVING_HEAR_POST_TRANSLATION "living_hear_after_translate"
6166

6267
///called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source)
6368
#define COMSIG_MOVABLE_DISPOSING "movable_disposing"

code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,14 @@
8787
#define COMPONENT_UPPERCASE_SPEECH (1<<0)
8888
// used to access COMSIG_MOB_SAY argslist
8989
#define SPEECH_MESSAGE 1
90-
// #define SPEECH_BUBBLE_TYPE 2
90+
#define SPEECH_BUBBLE_TYPE 2
9191
#define SPEECH_SPANS 3
92-
// #define SPEECH_SANITIZE 4
92+
#define SPEECH_SANITIZE 4
9393
#define SPEECH_LANGUAGE 5
94-
/* #define SPEECH_IGNORE_SPAM 6
95-
#define SPEECH_FORCED 7 */
96-
#define SPEECH_RANGE 8
94+
#define SPEECH_IGNORE_SPAM 6
95+
#define SPEECH_FORCED 7
96+
#define SPEECH_FILTERPROOF 8
97+
#define SPEECH_RANGE 9
9798

9899
///from /mob/say_dead(): (mob/speaker, message)
99100
#define COMSIG_MOB_DEADSAY "mob_deadsay"

code/__DEFINES/dcs/signals/signals_object.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@
289289

290290
///called from base of /obj/item/radio/proc/set_frequency(): (list/args)
291291
#define COMSIG_RADIO_NEW_FREQUENCY "radio_new_frequency"
292-
///called during SSpacketnets/proc/ImmediateSubspaceVocalSend(): (message, freq_num)
292+
#define COMSIG_RADIO_NEW_MESSAGE "radio_new_message"
293+
///called during SSpacketnets/proc/ImmediateSubspaceVocalSend(): (speaker, message, freq_num, data)
293294
#define COMSIG_RADIO_RECEIVE "radio_receive"
294295
// /obj/item/pen signals
295-
296296
///called after rotation in /obj/item/pen/attack_self(): (rotation, mob/living/carbon/user)
297297
#define COMSIG_PEN_ROTATED "pen_rotated"
298298

code/__DEFINES/language.dm

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
#define NO_STUTTER 1
2-
#define TONGUELESS_SPEECH 2
3-
#define LANGUAGE_HIDE_ICON_IF_UNDERSTOOD 4
4-
#define LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD 8
1+
#define NO_STUTTER (1<<0)
2+
#define TONGUELESS_SPEECH (1<<1)
3+
#define LANGUAGE_HIDE_ICON_IF_UNDERSTOOD (1<<2)
4+
#define LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD (1<<3)
5+
#define LANGUAGE_CAN_WHISPER (1<<4)
6+
#define LANGUAGE_SELECTABLE_SPEAK (1<<5)
7+
#define LANGUAGE_SELECTABLE_UNDERSTAND (1<<6)
8+
#define LANGUAGE_OVERRIDE_SAY_MOD (1<<7)
59

610
// LANGUAGE SOURCE DEFINES
711
#define LANGUAGE_ALL "all" // For use in full removal only.
@@ -22,3 +26,6 @@
2226
#define LANGUAGE_SOFTWARE "software"
2327
#define LANGUAGE_STONER "stoner"
2428
#define LANGUAGE_VOICECHANGE "voicechange"
29+
30+
#define LANGUAGE_UNDERSTAND (1<<0)
31+
#define LANGUAGE_SPEAK (1<<1)

code/__DEFINES/mobs.dm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,3 +814,7 @@ GLOBAL_LIST_INIT(voice_type2sound_ref, voice_type2sound)
814814
#define MOB_ATTACKEDBY_FAIL 0
815815
#define MOB_ATTACKEDBY_SUCCESS 1
816816
#define MOB_ATTACKEDBY_NO_DAMAGE 2
817+
818+
#define BLIND_NOT_BLIND 0
819+
#define BLIND_PHYSICAL 1
820+
#define BLIND_SLEEPING 2

code/__DEFINES/say.dm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757

5858
#define MODE_CUSTOM_SAY_ERASE_INPUT "erase_input"
5959

60+
#define MODE_NO_QUOTE "no_quote"
61+
6062
//Spans. Robot speech, italics, etc. Applied in compose_message().
6163
#define SPAN_ROBOT "robot"
6264
#define SPAN_YELL "yell"
@@ -74,7 +76,11 @@
7476
#define REDUCE_RANGE (1<<1)
7577
#define NOPASS (1<<2)
7678

77-
//Eavesdropping
79+
/// Range to hear normal messages
80+
#define MESSAGE_RANGE 7
81+
/// Range to hear whispers normally
82+
#define WHISPER_RANGE 1
83+
/// Additional range to partially hear whispers
7884
#define EAVESDROP_EXTRA_RANGE 1 //how much past the specified message_range does the message get starred, whispering only
7985

8086
/// How close intercoms can be for radio code use

code/__DEFINES/spaceman_dmm.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@
4040
/world/Del()
4141
var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
4242
if (debug_server)
43-
call(debug_server, "auxtools_shutdown")()
43+
call_ext(debug_server, "auxtools_shutdown")()
4444
. = ..()

code/__DEFINES/traits.dm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
252252
#define TRAIT_NO_PAINSHOCK "no_painshock"
253253
/// Does not get addicted
254254
#define TRAIT_NO_ADDICTION "no_addiction"
255+
/// Makes whispers clearly heard from seven tiles away, the full hearing range
256+
#define TRAIT_GOOD_HEARING "good_hearing"
255257

256258
// Stops the mob from slipping on water, or banana peels, or pretty much anything that doesn't have [GALOSHES_DONT_HELP] set
257259
#define TRAIT_NO_SLIP_WATER "NO_SLIP_WATER"
@@ -357,10 +359,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
357359
#define TRAIT_TUMOR_SUPPRESSED "brain_tumor_suppressed"
358360
/// overrides the update_fire proc to always add fire (for lava)
359361
#define TRAIT_PERMANENTLY_ONFIRE "permanently_onfire"
360-
/// Galactic Common Sign Language
361-
#define TRAIT_SIGN_LANG "sign_language"
362-
/// This mob is able to use sign language over the radio.
363-
#define TRAIT_CAN_SIGN_ON_COMMS "can_sign_on_comms"
364362
/// nobody can use martial arts on this mob
365363
#define TRAIT_MARTIAL_ARTS_IMMUNE "martial_arts_immune"
366364
/// You've been cursed with a living duffelbag, and can't have more added
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#define SEC_RESTRICTED_QUIRKS "Blind" = TRUE, "Brain Tumor" = TRUE, "Deaf" = TRUE, "Paraplegic" = TRUE, "Mute" = TRUE, "Foreigner" = TRUE, "Pacifist" = TRUE, "Chunky Fingers" = TRUE
2-
#define HEAD_RESTRICTED_QUIRKS "Blind" = TRUE, "Deaf" = TRUE, "Mute" = TRUE, "Foreigner" = TRUE, "Chunky Fingers" = TRUE
1+
#define SEC_RESTRICTED_QUIRKS "Blind" = TRUE, "Brain Tumor" = TRUE, "Deaf" = TRUE, "Paraplegic" = TRUE, "Mute" = TRUE, "Pacifist" = TRUE, "Chunky Fingers" = TRUE
2+
#define HEAD_RESTRICTED_QUIRKS "Blind" = TRUE, "Deaf" = TRUE, "Mute" = TRUE, "Chunky Fingers" = TRUE
33
#define TECH_RESTRICTED_QUIRKS "Chunky Fingers" = TRUE

code/__HELPERS/global_lists.dm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109

110110
init_blood_types()
111111

112+
init_language_datums()
113+
112114
/// Inits the crafting recipe list, sorting crafting recipe requirements in the process.
113115
/proc/init_crafting_recipes(list/crafting_recipes)
114116
for(var/path in subtypesof(/datum/crafting_recipe))
@@ -251,3 +253,15 @@ GLOBAL_LIST_INIT(magnet_error_codes, list(
251253
if(isabstract(path))
252254
continue
253255
GLOB.blood_datums[path] = new path()
256+
257+
/proc/init_language_datums()
258+
for(var/datum/language/language as anything in subtypesof(/datum/language))
259+
if(isabstract(language) || !initial(language.key))
260+
continue
261+
262+
var/datum/language/instance = new language
263+
GLOB.all_languages += instance
264+
GLOB.language_datum_instances[language] = instance
265+
266+
if(instance.flags & (LANGUAGE_SELECTABLE_SPEAK | LANGUAGE_SELECTABLE_UNDERSTAND))
267+
GLOB.preference_language_types += language

code/_globalvars/lists/mobs.dm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ GLOBAL_LIST_EMPTY(current_observers_list)
5555
///underages who have been reported to security for trying to buy things they shouldn't, so they can't spam
5656
GLOBAL_LIST_EMPTY(narcd_underages)
5757

58+
#define GET_LANGUAGE_DATUM(lang) (istype(lang, /datum/language) ? lang : GLOB.language_datum_instances[lang])
59+
5860
GLOBAL_LIST_EMPTY(language_datum_instances)
5961
GLOBAL_LIST_EMPTY(all_languages)
62+
GLOBAL_LIST_EMPTY(preference_language_types)
6063

6164
GLOBAL_LIST_EMPTY(sentient_disease_instances)
6265

code/_globalvars/traits.dm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ GLOBAL_LIST_INIT(traits_by_type, list(
128128
"TRAIT_NICE_SHOT" = TRAIT_NICE_SHOT,
129129
"TRAIT_TUMOR_SUPPRESSION" = TRAIT_TUMOR_SUPPRESSED,
130130
"TRAIT_PERMANENTLY_ONFIRE" = TRAIT_PERMANENTLY_ONFIRE,
131-
"TRAIT_SIGN_LANG" = TRAIT_SIGN_LANG,
132131
"TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE" = TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE,
133132
"TRAIT_WINE_TASTER" = TRAIT_WINE_TASTER,
134133
"TRAIT_BONSAI" = TRAIT_BONSAI,

code/_onclick/hud/fullscreen.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@
112112
layer = BLIND_LAYER
113113
plane = FULLSCREEN_PLANE
114114

115+
/atom/movable/screen/fullscreen/blind/blinder
116+
icon_state = "blackerimageoverlay"
117+
layer = BLIND_LAYER + 0.01
118+
plane = FULLSCREEN_PLANE
119+
115120
/atom/movable/screen/fullscreen/curse
116121
icon_state = "curse"
117122
layer = CURSE_LAYER

code/controllers/subsystem/economy.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ SUBSYSTEM_DEF(economy)
126126
"Attention staff of [station_name()], you have received payment for this period. You may withdraw funds from your nearest ATM.",
127127
"Station Announcement",
128128
"Staff Update",
129+
do_not_modify = TRUE,
129130
)
130131

131132
//price_update() This doesn't need to fire every 5 minutes. The only current use is market crash, which handles it on its own.

code/controllers/subsystem/language.dm

Lines changed: 0 additions & 18 deletions
This file was deleted.

code/controllers/subsystem/packetnets.dm

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -195,35 +195,6 @@ SUBSYSTEM_DEF(packets)
195195

196196
cost_radios = MC_AVERAGE(cost_radios, TICK_DELTA_TO_MS(cached_cost))
197197
resumed = FALSE
198-
// stage = SSPACKETS_TABLETS
199-
200-
// if(stage == SSPACKETS_TABLETS)
201-
// timer = TICK_USAGE_REAL
202-
// if(!resumed)
203-
// cached_cost = 0
204-
// last_processed_tablet_message_packets = 0
205-
206-
// var/datum/signal/subspace/messaging/tablet_msg/packet
207-
// while(length(current_tablet_messages))
208-
// packet = current_tablet_messages[1]
209-
// current_tablet_messages.Cut(1,2)
210-
// queued_tablet_messages -= packet
211-
212-
// if (!packet.logged) // Can only go through if a message server logs it
213-
// continue
214-
215-
// for (var/obj/item/modular_computer/comp in packet.data["targets"])
216-
// var/obj/item/computer_hardware/hard_drive/drive = comp.all_components[MC_HDD]
217-
// for(var/datum/computer_file/program/messenger/app in drive.stored_files)
218-
// app.receive_message(packet)
219-
220-
// cached_cost += TICK_USAGE_REAL - timer
221-
// last_processed_tablet_message_packets++
222-
// if(MC_TICK_CHECK)
223-
// return
224-
225-
// cost_tablets = MC_AVERAGE(cost_tablets, TICK_DELTA_TO_MS(cached_cost))
226-
// resumed = FALSE
227198
stage = SSPACKETS_SUBSPACE_VOCAL
228199

229200
if(stage == SSPACKETS_SUBSPACE_VOCAL)
@@ -405,17 +376,17 @@ SUBSYSTEM_DEF(packets)
405376
var/rendered = virt.compose_message(virt, language, message, frequency, spans)
406377

407378
for(var/obj/item/radio/radio as anything in receive)
408-
SEND_SIGNAL(radio, COMSIG_RADIO_RECEIVE, virt.source, message, frequency)
379+
SEND_SIGNAL(radio, COMSIG_RADIO_RECEIVE, virt.source, message, frequency, data)
409380
for(var/atom/movable/hearer as anything in receive[radio])
410381
if(!hearer)
411382
stack_trace("null found in the hearers list returned by the spatial grid. this is bad")
412383
continue
413384

414-
hearer.Hear(rendered, virt, language, message, frequency, spans, message_mods, sound_loc = radio.speaker_location())
385+
hearer.Hear(rendered, virt, language, message, frequency, spans, message_mods, sound_loc = radio.speaker_location(), message_range = INFINITY)
415386

416387
// Let the global hearers (ghosts, etc) hear this message
417388
for(var/atom/movable/hearer as anything in globally_receiving)
418-
hearer.Hear(rendered, virt, language, message, frequency, spans, message_mods)
389+
hearer.Hear(rendered, virt, language, message, frequency, spans, message_mods, message_range = INFINITY)
419390

420391
// This following recording is intended for research and feedback in the use of department radio channels
421392
if(length(receive))

code/datums/brain_damage/hypnosis.dm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,7 @@
6666
new /datum/hallucination/chat(owner, TRUE, FALSE, span_hypnophrase("[hypnotic_phrase]"))
6767

6868
/datum/brain_trauma/hypnosis/handle_hearing(datum/source, list/hearing_args)
69+
var/datum/language/L = hearing_args[HEARING_LANGUAGE]
70+
if(istype(L, /datum/language/visual) || !L?.can_receive_language(owner))
71+
return
6972
hearing_args[HEARING_RAW_MESSAGE] = target_phrase.Replace(hearing_args[HEARING_RAW_MESSAGE], span_hypnophrase("$1"))

code/datums/brain_damage/imaginary_friend.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192

193193
friend_talk(message)
194194

195-
/mob/camera/imaginary_friend/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, list/message_mods = list(), atom/sound_loc)
195+
/mob/camera/imaginary_friend/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, list/message_mods = list(), atom/sound_loc, message_range)
196196
if (client?.prefs.read_preference(/datum/preference/toggle/enable_runechat) && (client.prefs.read_preference(/datum/preference/toggle/enable_runechat_non_mobs) || ismob(speaker)))
197197
create_chat_message(speaker, message_language, raw_message, spans, sound_loc = sound_loc)
198198
to_chat(src, compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mods))

code/datums/brain_damage/mild.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@
235235
/datum/brain_trauma/mild/mind_echo/handle_hearing(datum/source, list/hearing_args)
236236
if(owner == hearing_args[HEARING_SPEAKER])
237237
return
238+
239+
var/datum/language/L = hearing_args[HEARING_LANGUAGE]
240+
if(istype(L, /datum/language/visual) || !L?.can_receive_language(owner) || !owner.has_language(L))
241+
return
242+
238243
if(hear_dejavu.len >= 5)
239244
if(prob(25))
240245
var/deja_vu = pick_n_take(hear_dejavu)

code/datums/brain_damage/phobia.dm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@
7878
return
7979

8080
/datum/brain_trauma/mild/phobia/handle_hearing(datum/source, list/hearing_args)
81-
if(!owner.can_hear() || !COOLDOWN_FINISHED(src, scare_cooldown)) //words can't trigger you if you can't hear them *taps head*
81+
var/datum/language/L = hearing_args[HEARING_LANGUAGE]
82+
if(!L?.can_receive_language(owner) || !owner.has_language(L))
83+
return
84+
if(!COOLDOWN_FINISHED(src, scare_cooldown)) //words can't trigger you if you can't hear them *taps head*
8285
return
8386
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
8487
return

code/datums/brain_damage/severe.dm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,13 @@
290290
owner.remove_status_effect(/datum/status_effect/trance)
291291

292292
/datum/brain_trauma/severe/hypnotic_trigger/handle_hearing(datum/source, list/hearing_args)
293-
if(!owner.can_hear())
294-
return
295293
if(owner == hearing_args[HEARING_SPEAKER])
296294
return
297295

296+
var/datum/language/L = hearing_args[HEARING_LANGUAGE]
297+
if(istype(L, /datum/language/visual) || !L?.can_receive_language(owner) || !owner.has_language(L))
298+
return
299+
298300
var/regex/reg = new("(\\b[REGEX_QUOTE(trigger_phrase)]\\b)","ig")
299301

300302
if(findtext(hearing_args[HEARING_RAW_MESSAGE], reg))

code/datums/brain_damage/split_personality.dm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,13 @@
216216
return //no random switching
217217

218218
/datum/brain_trauma/severe/split_personality/brainwashing/handle_hearing(datum/source, list/hearing_args)
219-
if(HAS_TRAIT(owner, TRAIT_DEAF) || owner == hearing_args[HEARING_SPEAKER])
219+
if(owner == hearing_args[HEARING_SPEAKER])
220220
return
221+
222+
var/datum/language/L = hearing_args[HEARING_LANGUAGE]
223+
if(istype(L, /datum/language/visual) || !L?.can_receive_language(owner) || !owner.has_language(L))
224+
return
225+
221226
var/message = hearing_args[HEARING_RAW_MESSAGE]
222227
if(findtext(message, codeword))
223228
hearing_args[HEARING_RAW_MESSAGE] = replacetext(message, codeword, span_warning("[codeword]"))

code/datums/chatmessage.dm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,10 @@
148148
LAZYADD(prefixes, "\icon[r_icon]")
149149

150150
// Append language icon if the language uses one
151-
var/datum/language/language_instance = GLOB.language_datum_instances[language]
152-
if (language_instance?.display_icon(owner))
151+
if (language?.display_icon(owner))
153152
var/icon/language_icon = LAZYACCESS(language_icons, language)
154153
if (isnull(language_icon))
155-
language_icon = icon(language_instance.icon, icon_state = language_instance.icon_state)
154+
language_icon = icon(language.icon, icon_state = language.icon_state)
156155
language_icon.Scale(CHAT_MESSAGE_ICON_SIZE, CHAT_MESSAGE_ICON_SIZE)
157156
LAZYSET(language_icons, language, language_icon)
158157
LAZYADD(prefixes, "\icon[language_icon]")
@@ -293,8 +292,7 @@
293292
if(runechat_flags & EMOTE_MESSAGE)
294293
new /datum/chatmessage(raw_message, sound_loc || speaker, src, message_language, list("emote", "italics"))
295294
else
296-
new /datum/chatmessage(lang_treat(speaker, message_language, raw_message, spans, null, TRUE), sound_loc || speaker, src, message_language, spans)
297-
295+
new /datum/chatmessage(raw_message, sound_loc || speaker, src, message_language, spans)
298296

299297
// Tweak these defines to change the available color ranges
300298
#define CM_COLOR_SAT_MIN 0.6

code/datums/components/codeword_hearing.dm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@
3737
/datum/component/codeword_hearing/proc/handle_hearing(datum/source, list/hearing_args)
3838
SIGNAL_HANDLER
3939

40+
var/mob/living/mob_owner = parent
41+
if(!istype(mob_owner))
42+
return
43+
44+
var/datum/language/L = hearing_args[HEARING_LANGUAGE]
45+
if(!L?.can_receive_language(mob_owner) || !mob_owner.has_language(L))
46+
return
47+
4048
var/message = hearing_args[HEARING_RAW_MESSAGE]
4149
message = replace_regex.Replace(message, "<span class='[span_class]'>$1</span>")
4250
hearing_args[HEARING_RAW_MESSAGE] = message

0 commit comments

Comments
 (0)