From 008293770a6549e06ebb6b7d3461611e9331aba9 Mon Sep 17 00:00:00 2001 From: mikomyazaki <47489928+mikomyazaki@users.noreply.github.com> Date: Wed, 19 Feb 2020 22:36:36 +0000 Subject: [PATCH] Adds a status_flag for mobs to prevent them being selected by auto-traitor. (#8302) --- code/__defines/mobs.dm | 1 + code/game/antagonist/antagonist_helpers.dm | 2 ++ code/modules/mob/living/carbon/human/human_species.dm | 5 +++++ html/changelogs/remotes_no_autotraitor.yml | 6 ++++++ 4 files changed, 14 insertions(+) create mode 100644 html/changelogs/remotes_no_autotraitor.yml diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index de8ddbf02a8..9447c9d965b 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -14,6 +14,7 @@ #define FAKEDEATH 0x2000 // Replaces stuff like changeling.changeling_fakedeath. #define DISFIGURED 0x4000 // Set but never checked. Remove this sometime and replace occurences with the appropriate organ code #define XENO_HOST 0x8000 // Tracks whether we're gonna be a baby alien's mummy. +#define NO_ANTAG 0x10000 // Players are restricted from gaining antag roles when occupying this mob // Grab levels. #define GRAB_PASSIVE 1 diff --git a/code/game/antagonist/antagonist_helpers.dm b/code/game/antagonist/antagonist_helpers.dm index fd3c4ba5c6e..d865cbc563d 100644 --- a/code/game/antagonist/antagonist_helpers.dm +++ b/code/game/antagonist/antagonist_helpers.dm @@ -13,6 +13,8 @@ return FALSE if(player.current.client.prefs && player.current.client.prefs.species in restricted_species) return FALSE + if(player.current && (player.current.status_flags & NO_ANTAG)) + return FALSE return TRUE /datum/antagonist/proc/antags_are_dead() diff --git a/code/modules/mob/living/carbon/human/human_species.dm b/code/modules/mob/living/carbon/human/human_species.dm index 9731679cf17..0eb7d34e71e 100644 --- a/code/modules/mob/living/carbon/human/human_species.dm +++ b/code/modules/mob/living/carbon/human/human_species.dm @@ -142,6 +142,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy/mannequin) dna.real_name = real_name if(mind) mind.name = real_name + status_flags |= NO_ANTAG remote_network = "remoterobots" SSvirtualreality.add_robot(src, remote_network) @@ -160,6 +161,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy/mannequin) dna.real_name = real_name if(mind) mind.name = real_name + status_flags |= NO_ANTAG /mob/living/carbon/human/industrial_xion_remote_mech/Stat() ..() @@ -175,6 +177,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy/mannequin) dna.real_name = real_name if(mind) mind.name = real_name + status_flags |= NO_ANTAG equip_to_slot_or_del(new /obj/item/clothing/under/assistantformal(src), slot_w_uniform) equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(src), slot_wear_suit) @@ -225,6 +228,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy/mannequin) dna.real_name = real_name if(mind) mind.name = real_name + status_flags |= NO_ANTAG remote_network = "remoterobots" SSvirtualreality.add_robot(src, remote_network) @@ -243,6 +247,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy/mannequin) dna.real_name = real_name if(mind) mind.name = real_name + status_flags |= NO_ANTAG equip_to_slot_or_del(new /obj/item/clothing/under/assistantformal(src), slot_w_uniform) equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(src), slot_wear_suit) diff --git a/html/changelogs/remotes_no_autotraitor.yml b/html/changelogs/remotes_no_autotraitor.yml new file mode 100644 index 00000000000..01f1c74ddf9 --- /dev/null +++ b/html/changelogs/remotes_no_autotraitor.yml @@ -0,0 +1,6 @@ +author: mikomyazaki + +delete-after: True + +changes: + - bugfix: "Remote robots are no longer valid targets for autotraitor." \ No newline at end of file