fixes second-choice headrevs having their preferences ignored (#95751)

## About The Pull Request

Second-choice headrevs after a first choice became indisposed did not
check client preferences.
Also, moves `ROLE_HEAD_REV` define into roundstart section of defines
because it is a roundstart ruleset

## Why It's Good For The Game

fixes #95742
This commit is contained in:
Leland Kemble
2026-04-13 12:37:10 -05:00
committed by GitHub
parent 8eb46a0487
commit 41ce7bf46c
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -15,6 +15,7 @@
#define ROLE_HERETIC "Heretic"
#define ROLE_MALF "Malf AI"
#define ROLE_OPERATIVE "Operative"
#define ROLE_REV_HEAD "Head Revolutionary"
#define ROLE_TRAITOR "Traitor"
#define ROLE_WIZARD "Wizard"
#define ROLE_SPY "Spy"
@@ -35,7 +36,6 @@
#define ROLE_OPERATIVE_MIDROUND "Operative (Midround)"
#define ROLE_CLOWN_OPERATIVE_MIDROUND "Clown Operative (Midround)"
#define ROLE_PARADOX_CLONE "Paradox Clone"
#define ROLE_REV_HEAD "Head Revolutionary"
#define ROLE_SLEEPER_AGENT "Syndicate Sleeper Agent"
#define ROLE_SPACE_DRAGON "Space Dragon"
#define ROLE_SPIDER "Spider"
@@ -363,7 +363,7 @@
addtimer(CALLBACK(src, PROC_REF(revs_execution_failed)), 1 MINUTES, TIMER_UNIQUE|TIMER_DELETE_ME)
return
if(!can_be_headrev(candidate))
if(!can_be_headrev(candidate, TRUE))
log_dynamic("[config_tag]: [key_name(candidate)] was not eligible to be a headrev after the timer expired - finding a replacement.")
find_another_headrev()
return
@@ -378,7 +378,7 @@
/datum/dynamic_ruleset/roundstart/revolution/proc/find_another_headrev()
for(var/mob/living/carbon/human/upstanding_citizen in GLOB.player_list)
if(!can_be_headrev(upstanding_citizen.mind))
if(!can_be_headrev(upstanding_citizen.mind, TRUE))
continue
reveal_head(upstanding_citizen.mind)
log_dynamic("[config_tag]: [key_name(upstanding_citizen)] was selected as a replacement headrev.")
@@ -405,9 +405,6 @@
for(var/datum/mind/khrushchev as anything in members - head_revolutionaries)
if(!can_be_headrev(khrushchev))
continue
var/client/khruschevs_client = GET_CLIENT(khrushchev.current)
if(!(ROLE_REV_HEAD in khruschevs_client.prefs.be_special) && !(ROLE_PROVOCATEUR in khruschevs_client.prefs.be_special))
continue
if(ismonkey(khrushchev.current))
monkey_promotable += khrushchev
else
@@ -150,7 +150,7 @@ GLOBAL_DATUM(revolution_handler, /datum/revolution_handler)
return objective_complete
/// Checks if someone is valid to be a headrev
/proc/can_be_headrev(datum/mind/candidate)
/proc/can_be_headrev(datum/mind/candidate, roundstart = FALSE)
var/turf/head_turf = get_turf(candidate.current)
if(considered_afk(candidate))
return FALSE
@@ -160,6 +160,9 @@ GLOBAL_DATUM(revolution_handler, /datum/revolution_handler)
return FALSE
if(candidate.current.is_antag())
return FALSE
var/client/candidate_client = GET_CLIENT(candidate.current)
if(!(ROLE_REV_HEAD in candidate_client.prefs.be_special) && (roundstart || !(ROLE_PROVOCATEUR in candidate_client.prefs.be_special)))
return FALSE
if(candidate.assigned_role.job_flags & JOB_HEAD_OF_STAFF)
return FALSE
if(HAS_MIND_TRAIT(candidate.current, TRAIT_UNCONVERTABLE))