Fix radio keys without spaces before message. (#32425)

This commit is contained in:
Alan
2026-08-14 00:17:29 +00:00
committed by GitHub
parent f6b562e6b6
commit b0c7497fce
2 changed files with 23 additions and 8 deletions
@@ -247,10 +247,12 @@
available_channels.Add(":n")
if("Medical")
available_channels.Add(":m")
if("Mining")
available_channels.Add(":d")
if("Cargo")
available_channels.Add(":q")
if("Supply")
available_channels.Add(":u")
if("Service")
available_channels.Add(":z")
if("Procedure")
available_channels.Add(":x")
if(ears.translate_binary)
available_channels.Add(":b")
+17 -4
View File
@@ -142,11 +142,24 @@
return standard_mode
if(length(message) >= 2)
var/channel_prefix = trim_right(copytext_char(message, 1, 4))
var/datum/language/L = GLOB.language_keys[channel_prefix]
var/channel_prefix_long = trim_right(copytext_char(message, 1, 4))
var/channel_prefix_short = trim_right(copytext_char(message, 1, 3))
// Check languages first. Deconflict your language/radio keys if this causes problems.
var/datum/language/L = GLOB.language_keys[channel_prefix_long]
if(L != null && can_speak_language(L))
return null // Deconflict your language/radio keys if this causes problems.
return GLOB.department_radio_keys[channel_prefix]
return null
L = GLOB.language_keys[channel_prefix_short]
if(L != null && can_speak_language(L))
return null
// Now check radio keys.
var/radio_key = GLOB.department_radio_keys[channel_prefix_long]
if(radio_key != null)
return radio_key
radio_key = GLOB.department_radio_keys[channel_prefix_short]
if(radio_key != null)
return radio_key
return null