AI Malf will no longer be able to spawn a non-antag AI

fixes #10554
This commit is contained in:
ccomp5950
2015-12-24 02:43:52 -05:00
parent 0ec20d6fa2
commit ccda750ee1
3 changed files with 5 additions and 36 deletions

View File

@@ -16,6 +16,8 @@ var/global/list/additional_antag_types = list()
var/ert_disabled = 0 // ERT cannot be called.
var/deny_respawn = 0 // Disable respawn during this round.
var/list/disabled_jobs = list() // Mostly used for Malf. This check is performed in job_controller so it doesn't spawn a regular AI.
var/shuttle_delay = 1 // Shuttle transit time is multiplied by this.
var/auto_recall_shuttle = 0 // Will the shuttle automatically be recalled?

View File

@@ -9,3 +9,4 @@
end_on_antag_death = 0
auto_recall_shuttle = 0
antag_tags = list(MODE_MALFUNCTION)
disabled_jobs = list("AI")

View File

@@ -185,36 +185,6 @@ var/global/datum/controller/occupations/job_master
return
proc/FillAIPosition()
var/ai_selected = 0
var/datum/job/job = GetJob("AI")
if(!job) return 0
if((job.title == "AI") && (config) && (!config.allow_ai)) return 0
for(var/i = job.total_positions, i > 0, i--)
for(var/level = 1 to 3)
var/list/candidates = list()
if(ticker.mode.name == "AI malfunction")//Make sure they want to malf if its malf
candidates = FindOccupationCandidates(job, level, BE_MALF)
else
candidates = FindOccupationCandidates(job, level)
if(candidates.len)
var/mob/new_player/candidate = pick(candidates)
if(AssignRole(candidate, "AI"))
ai_selected++
break
//Malf NEEDS an AI so force one if we didn't get a player who wanted it
if((ticker.mode.name == "AI malfunction")&&(!ai_selected))
unassigned = shuffle(unassigned)
for(var/mob/new_player/player in unassigned)
if(jobban_isbanned(player, "AI")) continue
if(AssignRole(player, "AI"))
ai_selected++
break
if(ai_selected) return 1
return 0
/** Proc DivideOccupations
* fills var "assigned_role" for all ready players.
* This proc must not have any side effect besides of modifying "assigned_role".
@@ -260,11 +230,6 @@ var/global/datum/controller/occupations/job_master
FillHeadPosition()
Debug("DO, Head Check end")
//Check for an AI
Debug("DO, Running AI Check")
FillAIPosition()
Debug("DO, AI Check end")
//Other jobs are now checked
Debug("DO, Running Standard Check")
@@ -275,6 +240,7 @@ var/global/datum/controller/occupations/job_master
// Loop through all levels from high to low
var/list/shuffledoccupations = shuffle(occupations)
// var/list/disabled_jobs = ticker.mode.disabled_jobs // So we can use .Find down below without a colon.
for(var/level = 1 to 3)
//Check the head jobs first each level
CheckHeadPositions(level)
@@ -284,7 +250,7 @@ var/global/datum/controller/occupations/job_master
// Loop through all jobs
for(var/datum/job/job in shuffledoccupations) // SHUFFLE ME BABY
if(!job)
if(!job || ticker.mode.disabled_jobs.Find(job.title) )
continue
if(jobban_isbanned(player, job.title))