Skip to content

Commit e4f4097

Browse files
authored
fixes admin whitelist bypass (#7198)
1 parent aea624f commit e4f4097

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

code/modules/mob/new_player/new_player.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ INITIALIZE_IMMEDIATE(/mob/new_player)
520520

521521
if(chosen_species && use_species_name)
522522
// Have to recheck admin due to no usr at roundstart. Latejoins are fine though.
523-
if(!(chosen_species.species_spawn_flags & SPECIES_SPAWN_WHITELISTED) || chosen_species.check_whitelist_for_ckey(ckey))
523+
if(!(chosen_species.species_spawn_flags & SPECIES_SPAWN_WHITELISTED) || chosen_species.check_whitelist_for_ckey(ckey) || has_admin_rights())
524524
new_character = new(T, use_species_name)
525525

526526
if(!new_character)
@@ -610,7 +610,7 @@ INITIALIZE_IMMEDIATE(/mob/new_player)
610610
if(!chosen_species)
611611
return SPECIES_HUMAN
612612

613-
if(!(chosen_species.species_spawn_flags & SPECIES_SPAWN_WHITELISTED) || chosen_species.check_whitelist_for_ckey(ckey))
613+
if(!(chosen_species.species_spawn_flags & SPECIES_SPAWN_WHITELISTED) || chosen_species.check_whitelist_for_ckey(ckey) || has_admin_rights())
614614
return chosen_species.name
615615

616616
return SPECIES_HUMAN

code/modules/preferences/preference_setup/background/species.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
. += SPAN_GREEN("do")
2222
else
2323
. += SPAN_RED("do not")
24-
. += " have the whitelist to play as one."
24+
. += " have the whitelist to play as one[check_rights(C = prefs.client) ? ", but have administrative override to do so" : ""]."
2525
. += "</center>"
2626
. += "<div class='statusDisplay'>"
2727
. += "[CS.blurb]"
@@ -32,7 +32,7 @@
3232
if((CS.species_spawn_flags & SPECIES_SPAWN_RESTRICTED) && !(flags & PREF_COPY_TO_NO_CHECK_SPECIES))
3333
errors?.Add(SPAN_WARNING("[CS.name] is a restricted species. You cannot join as this as most normal roles."))
3434
return FALSE
35-
if((CS.species_spawn_flags & SPECIES_SPAWN_WHITELISTED) && !CS.check_whitelist_for_ckey(prefs.client_ckey))
35+
if((CS.species_spawn_flags & SPECIES_SPAWN_WHITELISTED) && !CS.check_whitelist_for_ckey(prefs.client_ckey) && !check_rights(C = prefs.client))
3636
errors?.Add(SPAN_WARNING("You do not have the whitelist to play as a [CS.name]."))
3737
return FALSE
3838
return TRUE

code/modules/preferences/preference_setup/helpers/species_pick.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* check if we can play a species
2121
*/
2222
/datum/preferences/proc/check_character_species(datum/species/CS)
23-
if((CS.species_spawn_flags & SPECIES_SPAWN_SECRET) && !CS.check_whitelist_for_ckey(client_ckey))
23+
if((CS.species_spawn_flags & SPECIES_SPAWN_SECRET) && !CS.check_whitelist_for_ckey(client_ckey) && !check_rights(C = client))
2424
return FALSE
2525
return TRUE
2626

0 commit comments

Comments
 (0)