diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index ea7e7ce812..efa6b8b59d 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -4,7 +4,7 @@ SUBSYSTEM_DEF(job) flags = SS_NO_FIRE var/list/occupations = list() //List of all jobs - var/list/name_occupations = list() //Dict of all jobs, keys are titles + var/list/datum/job/name_occupations = list() //Dict of all jobs, keys are titles var/list/type_occupations = list() //Dict of all jobs, keys are types var/list/unassigned = list() //Players who need jobs var/initial_players_to_assign = 0 //used for checking against population caps @@ -14,6 +14,8 @@ SUBSYSTEM_DEF(job) var/overflow_role = "Assistant" + var/list/level_order = list(JP_HIGH,JP_MEDIUM,JP_LOW) + /datum/controller/subsystem/job/Initialize(timeofday) SSmapping.HACK_LoadMapConfig() if(!occupations.len) @@ -119,7 +121,7 @@ SUBSYSTEM_DEF(job) if(player.mind && job.title in player.mind.restricted_roles) JobDebug("FOC incompatible with antagonist role, Player: [player]") continue - if(player.client.prefs.job_preferences["[job.title]"] == level) + if(player.client.prefs.job_preferences[job.title] == level) JobDebug("FOC pass, Player: [player], Level:[level]") candidates += player return candidates @@ -181,7 +183,7 @@ SUBSYSTEM_DEF(job) //it locates a head or runs out of levels to check //This is basically to ensure that there's atleast a few heads in the round /datum/controller/subsystem/job/proc/FillHeadPosition() - for(var/level = 1 to 3) + for(var/level in level_order) for(var/command_position in GLOB.command_positions) var/datum/job/job = GetJob(command_position) if(!job) @@ -218,7 +220,7 @@ SUBSYSTEM_DEF(job) if(!job) return 0 for(var/i = job.total_positions, i > 0, i--) - for(var/level = 1 to 3) + for(var/level in level_order) var/list/candidates = list() candidates = FindOccupationCandidates(job, level) if(candidates.len) @@ -304,8 +306,7 @@ SUBSYSTEM_DEF(job) // Loop through all levels from high to low var/list/shuffledoccupations = shuffle(occupations) - var/list/levels = list(JP_HIGH,JP_MEDIUM,JP_LOW) - for(var/level in levels) + for(var/level in level_order) //Check the head jobs first each level CheckHeadPositions(level) @@ -334,7 +335,7 @@ SUBSYSTEM_DEF(job) if(job.required_playtime_remaining(player.client)) JobDebug("DO player not enough xp, Player: [player], Job:[job.title]") continue - + if(!player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features)) JobDebug("DO non-human failed, Player: [player], Job:[job.title]") continue @@ -344,7 +345,7 @@ SUBSYSTEM_DEF(job) continue // If the player wants that job on this level, then try give it to him. - if(player.client.prefs.job_preferences["[job.title]"] == level) + if(player.client.prefs.job_preferences[job.title] == level) // If the job isn't filled if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1) JobDebug("DO pass, Player: [player], Level:[level], Job:[job.title]") @@ -475,7 +476,6 @@ SUBSYSTEM_DEF(job) to_chat(M, "[job.custom_spawn_text]") if(CONFIG_GET(number/minimal_access_threshold)) to_chat(M, "As this station was initially staffed with a [CONFIG_GET(flag/jobs_have_minimal_access) ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] have been added to your ID card.") - if(job && H) if(job.dresscodecompliant)// CIT CHANGE - dress code compliance equip_loadout(N, H) // CIT CHANGE - allows players to spawn with loadout items @@ -551,7 +551,7 @@ SUBSYSTEM_DEF(job) if(job.required_playtime_remaining(player.client)) young++ continue - switch(player.client.prefs.job_preferences["[job.title]"]) + switch(player.client.prefs.job_preferences[job.title]) if(JP_HIGH) high++ if(JP_MEDIUM) @@ -698,4 +698,4 @@ SUBSYSTEM_DEF(job) . |= player.mind /datum/controller/subsystem/job/proc/JobDebug(message) - log_job_debug(message) + log_job_debug(message) \ No newline at end of file