Skip to content

Commit

Permalink
Adds radio blacklist for non radio tokens in use (#16224)
Browse files Browse the repository at this point in the history
Co-authored-by: ivanmixo <[email protected]>
  • Loading branch information
Ldip999 and ivanmixo authored Jul 5, 2024
1 parent 2c7a17b commit b468c54
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions code/datums/jobs/squads.dm
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@
GLOBAL_LIST_EMPTY_TYPED(custom_squad_radio_freqs, /datum/squad)
///initializes a new custom squad. all args mandatory
/proc/create_squad(squad_name, squad_color, mob/living/carbon/human/creator)
var/list/radio_blacklist = list(MODE_KEY_BINARY, MODE_KEY_R_HAND, MODE_KEY_L_HAND, MODE_KEY_INTERCOM, MODE_KEY_DEPARTMENT)
//Create the squad
if(!squad_name)
return
Expand All @@ -443,15 +444,15 @@ GLOBAL_LIST_EMPTY_TYPED(custom_squad_radio_freqs, /datum/squad)
LAZYADDASSOCSIMPLE(GLOB.reverseradiochannels, "[freq]", radio_channel_name)
new_squad.faction = squad_faction
var/key_prefix = lowertext_name[1]
if(GLOB.department_radio_keys[key_prefix])
if(GLOB.department_radio_keys[key_prefix] || (key_prefix in radio_blacklist))
for(var/letter in splittext(lowertext_name, ""))
if(!GLOB.department_radio_keys[letter])
if(!(GLOB.department_radio_keys[letter] && !(letter in radio_blacklist)))
key_prefix = letter
break
if(GLOB.department_radio_keys[key_prefix])
if(GLOB.department_radio_keys[key_prefix] || (key_prefix in radio_blacklist))
//okay... mustve been a very short name, randomly pick things from the alphabet now
for(var/letter in shuffle(GLOB.alphabet))
if(!GLOB.department_radio_keys[letter])
if(!(GLOB.department_radio_keys[letter] && !(letter in radio_blacklist)))
key_prefix = letter
break

Expand Down

0 comments on commit b468c54

Please sign in to comment.