From c3b15103564d47e6cbf79bb3b339babfec36a7bd Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 15 Jan 2022 17:28:00 +0100 Subject: [PATCH] [MIRROR] Fixes the mess between ROLE_REV and ROLE_REV_HEAD [MDB IGNORE] (#10705) * Fixes the mess between ROLE_REV and ROLE_REV_HEAD (#64068) * Fixes the mess between ROLE_REV and ROLE_REV_HEAD * Update code/modules/client/preferences/migrations/tgui_prefs_migration.dm Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * Update revolution.dm Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * Fixes the mess between ROLE_REV and ROLE_REV_HEAD Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> --- code/__DEFINES/role_preferences.dm | 1 - code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm | 2 +- code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm | 2 +- code/modules/antagonists/revolution/revolution.dm | 3 ++- .../client/preferences/migrations/tgui_prefs_migration.dm | 2 ++ 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm index 9c128ea68fa..f9ace7a20d3 100644 --- a/code/__DEFINES/role_preferences.dm +++ b/code/__DEFINES/role_preferences.dm @@ -145,7 +145,6 @@ GLOBAL_LIST_INIT(special_roles, list( ROLE_SYNDICATE_INFILTRATOR = 0, // I'm not too sure why these are here, but they're not moving. - ROLE_REV = 14, ROLE_PAI = 0, ROLE_INTERNAL_AFFAIRS = 0, ROLE_SENTIENCE = 0, diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm index da5eda040b2..b2e511d2606 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm @@ -98,7 +98,7 @@ persistent = TRUE antag_datum = /datum/antagonist/rev/head antag_flag = ROLE_PROVOCATEUR - antag_flag_override = ROLE_REV + antag_flag_override = ROLE_REV_HEAD restricted_roles = list( JOB_AI, JOB_CYBORG, diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm index 25475f67961..fb8e01c193f 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm @@ -542,7 +542,7 @@ name = "Revolution" persistent = TRUE antag_flag = ROLE_REV_HEAD - antag_flag_override = ROLE_REV + antag_flag_override = ROLE_REV_HEAD antag_datum = /datum/antagonist/rev/head minimum_required_age = 14 restricted_roles = list( diff --git a/code/modules/antagonists/revolution/revolution.dm b/code/modules/antagonists/revolution/revolution.dm index 20e7b6cea60..88ad84a8d1a 100644 --- a/code/modules/antagonists/revolution/revolution.dm +++ b/code/modules/antagonists/revolution/revolution.dm @@ -162,6 +162,7 @@ /datum/antagonist/rev/head name = "\improper Head Revolutionary" antag_hud_name = "rev_head" + job_rank = ROLE_REV_HEAD preview_outfit = /datum/outfit/revolutionary @@ -368,7 +369,7 @@ var/list/datum/mind/nonhuman_promotable = list() for(var/datum/mind/khrushchev in non_heads) if(khrushchev.current && !khrushchev.current.incapacitated() && !HAS_TRAIT(khrushchev.current, TRAIT_RESTRAINED) && khrushchev.current.client) - if(ROLE_REV in khrushchev.current.client.prefs.be_special) + if((ROLE_REV_HEAD in khrushchev.current.client.prefs.be_special) || (ROLE_PROVOCATEUR in khrushchev.current.client.prefs.be_special)) if(ishuman(khrushchev.current)) promotable += khrushchev else diff --git a/code/modules/client/preferences/migrations/tgui_prefs_migration.dm b/code/modules/client/preferences/migrations/tgui_prefs_migration.dm index c6492dfa60a..3b9e1b48fab 100644 --- a/code/modules/client/preferences/migrations/tgui_prefs_migration.dm +++ b/code/modules/client/preferences/migrations/tgui_prefs_migration.dm @@ -43,6 +43,8 @@ // "Familes [sic] Antagonists" was the old name of the catch-all. migrate_antagonist("Familes Antagonists", list(ROLE_FAMILIES, ROLE_FAMILY_HEAD_ASPIRANT)) +// If you have an antagonist enabled, it will add the alternative preferences for said antag in be_special. +// will_exist is the role we check if enabled, to_add list is the antagonists we add onto the be_special list. /datum/preferences/proc/migrate_antagonist(will_exist, list/to_add) if (will_exist in be_special) for (var/add in to_add)