Fixes antag spawning issues (#5773)

Fixes #5772
This is a bug that seemed to have existed for a while and was not cause by my new system.
This commit is contained in:
BurgerLUA
2018-12-16 01:35:13 +02:00
committed by Erki
parent 7251548a8b
commit 3b475be87b
2 changed files with 46 additions and 10 deletions
+9 -10
View File
@@ -152,36 +152,35 @@ var/global/list/additional_antag_types = list()
var/playerC = 0
for(var/mob/abstract/new_player/player in player_list)
if((player.client)&&(player.ready))
if(player.client && player.ready)
playerC++
if(playerC < required_players && required_players != 0)
if(required_players && playerC < required_players)
returning |= GAME_FAILURE_NO_PLAYERS
if(playerC > max_players && max_players != 0)
if(max_players && playerC > max_players)
returning |= GAME_FAILURE_TOO_MANY_PLAYERS
var/total_enemy_count = 0
if(antag_templates && antag_templates.len)
var/enemy_count = 0
if(antag_tags && antag_tags.len)
for(var/antag_tag in antag_tags)
var/datum/antagonist/antag = all_antag_types[antag_tag]
if(!antag)
continue
var/list/potential = list()
var/list/potential = list() //List of potential players to spawn as antagonists
if(antag.flags & ANTAG_OVERRIDE_JOB)
potential = antag.pending_antagonists
else
potential = antag.candidates
if(islist(potential))
if(potential.len)
enemy_count += potential.len
if(require_all_templates && potential.len < antag.initial_spawn_req)
total_enemy_count += potential.len
if(antag.initial_spawn_req && require_all_templates && potential.len < antag.initial_spawn_req)
returning |= GAME_FAILURE_NO_ANTAGS
if(enemy_count < required_enemies)
returning |= GAME_FAILURE_NO_ANTAGS
if(required_enemies && total_enemy_count < required_enemies)
returning |= GAME_FAILURE_NO_ANTAGS
return returning
+37
View File
@@ -0,0 +1,37 @@
################################
# 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
#################################
# Your name.
author: BurgerBB
# 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: "Fixes an age-old bug that caused antags not to spawn despite meeting the requirements, and antags to spawn despite not meeting the requirements."