mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Fix radio keys without spaces before message. (#32425)
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user