Players who are assigned restricted jobs will be removed from the antag candidate list (#9729)

This commit is contained in:
mikomyazaki
2020-08-22 10:22:30 +01:00
committed by GitHub
parent a4e2154f51
commit 2da2e50644
2 changed files with 47 additions and 0 deletions
+6
View File
@@ -185,6 +185,12 @@ var/global/list/additional_antag_types = list()
else
potential = antag.candidates
if(islist(potential))
for(var/potential_antag in potential)
var/datum/mind/player = potential_antag
if(!(antag.flags & ANTAG_OVERRIDE_JOB) && (player.assigned_role in antag.restricted_jobs))
potential -= potential_antag
antag.candidates -= player
log_debug("GAMEMODE: Player [player.name] ([player.key]) was removed from the potential antags list due to being given the role [player.assigned_role] which is a restricted job!")
if(potential.len)
log_debug("GAMEMODE: Found [potential.len] potential antagonists for [antag.role_text].")
total_enemy_count += potential.len
+41
View File
@@ -0,0 +1,41 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: mikomyazaki
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Players who are given roles restricted from an antag role they were selected for will now be removed from that role's candidate list - This may result in a game mode reset due to lack of antagonists, but it will prevent the mode spawning with too few antagonists."