Merge pull request #4982 from RemieRichards/AntagBeforeJobFixes

Fixes some bizarre job+antag interactions
This commit is contained in:
Cheridan
2014-09-28 21:53:56 -05:00
3 changed files with 33 additions and 10 deletions
+1 -1
View File
@@ -74,6 +74,7 @@
var/datum/mind/cultist = pick(antag_candidates)
antag_candidates -= cultist
cult += cultist
cultist.special_role = "Cultist"
log_game("[cultist.key] (ckey) has been selected as a cultist")
return (cult.len>=required_enemies)
@@ -104,7 +105,6 @@
update_cult_icons_added(cult_mind)
cult_mind.current << "<span class='notice'>You are a member of the cult!</span>"
memorize_cult_objectives(cult_mind)
cult_mind.special_role = "Cultist"
..()
+6
View File
@@ -46,6 +46,12 @@
if(!A_bosses.len || !B_bosses.len)
return 0
//Set a temporary special_role so the job controller doesn't hand out invalid jobs for these antags
for(var/datum/mind/boss_mind in A_bosses)
boss_mind.special_role = "Gang member"
for(var/datum/mind/boss_mind in B_bosses)
boss_mind.special_role = "Gang member"
return 1
+26 -9
View File
@@ -46,9 +46,11 @@ var/global/datum/controller/occupations/job_master
if(!job) return 0
if(jobban_isbanned(player, rank)) return 0
if(!job.player_old_enough(player.client)) return 0
if(player.mind.special_role && ticker && ticker.mode && (job.title in ticker.mode.restricted_jobs))
if(player.mind.special_role && ticker && ticker.mode)
if(job.title in ticker.mode.restricted_jobs)
return 0
if(!player.mind.need_job_assign)
return 0
var/position_limit = job.total_positions
if(!latejoin)
position_limit = job.spawn_positions
@@ -79,9 +81,13 @@ var/global/datum/controller/occupations/job_master
if(config.enforce_human_authority && (job.title in command_positions) && player.client.prefs.pref_species.id != "human")
Debug("FOC non-human failed, Player: [player]")
continue
if(player.mind.special_role && ticker && ticker.mode && (job.title in ticker.mode.restricted_jobs))
Debug("FOC player has a special role and this job is blocked from this special role")
if(player.mind.special_role && ticker && ticker.mode)
if(job.title in ticker.mode.restricted_jobs)
Debug("FOC player has a special role and this job is blocked from this special role")
continue
if(!player.mind.need_job_assign)
continue
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
@@ -113,8 +119,12 @@ var/global/datum/controller/occupations/job_master
Debug("GRJ non-human failed, Player: [player]")
continue
if(player.mind.special_role && ticker && ticker.mode && (job.title in ticker.mode.restricted_jobs))
Debug("GRJ player has a special role and this job is blocked from this special role")
if(player.mind.special_role && ticker && ticker.mode)
if(job.title in ticker.mode.restricted_jobs)
Debug("GRJ player has a special role and this job is blocked from this special role")
continue
if(!player.mind.need_job_assign)
continue
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
@@ -272,8 +282,12 @@ var/global/datum/controller/occupations/job_master
Debug("DO non-human failed, Player: [player], Job:[job.title]")
continue
if(player.mind.special_role && ticker && ticker.mode && (job.title in ticker.mode.restricted_jobs))
Debug("DO player has a special role and this job is blocked from that special role")
if(player.mind.special_role && ticker && ticker.mode)
if(job.title in ticker.mode.restricted_jobs)
Debug("DO player has a special role and this job is blocked from that special role")
continue
if(!player.mind.need_job_assign)
continue
// If the player wants that job on this level, then try give it to him.
@@ -304,6 +318,9 @@ var/global/datum/controller/occupations/job_master
//Gives the player the stuff he should have with his rank
/datum/controller/occupations/proc/EquipRank(var/mob/living/H, var/rank, var/joined_late = 0)
if(!H.mind.need_job_assign)
return 0
var/datum/job/job = GetJob(rank)
H.job = rank