diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index f4307eed6d2..0548d94f3d1 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -19,7 +19,6 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/list/region_access = null var/list/head_subordinates = null var/target_dept = 0 //Which department this computer has access to. 0=all departments - var/prioritycount = 0 // we don't want 500 prioritized jobs //Cooldown for closing positions in seconds //if set to -1: No cooldown... probably a bad idea @@ -209,7 +208,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if(job in SSjob.prioritized_jobs) dat += "Deprioritize" else - if(prioritycount < 5) + if(SSjob.prioritized_jobs.len < 5) dat += "Prioritize" else dat += "Denied" @@ -530,11 +529,12 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/priority = TRUE if(j in SSjob.prioritized_jobs) SSjob.prioritized_jobs -= j - prioritycount-- priority = FALSE + else if(j.total_positions <= j.current_positions) + to_chat(usr, "[j.title] has had all positions filled. Open up more slots before prioritizing it.") + return else SSjob.prioritized_jobs += j - prioritycount++ to_chat(usr, "[j.title] has been successfully [priority ? "prioritized" : "unprioritized"]. Potential employees will notice your request.") playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 816e3b655a2..d9448d8f419 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -408,6 +408,11 @@ if(job && IsJobAvailable(job.title)) available_job_count++; + + for(var/datum/job/prioritized_job in SSjob.prioritized_jobs) + if(prioritized_job.current_positions >= prioritized_job.total_positions) + SSjob.prioritized_jobs -= prioritized_job + if(length(SSjob.prioritized_jobs)) dat += "