diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 29f2420b508..841935b6c28 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -60,6 +60,12 @@ var/global/datum/controller/occupations/job_master Debug("AR has failed, Player: [player], Rank: [rank]") return 0 + proc/FreeRole(var/rank) //making additional slot on the fly + var/datum/job/job = GetJob(rank) + if(job && job.current_positions >= job.total_positions) + job.total_positions++ + return 1 + return 0 proc/FindOccupationCandidates(datum/job/job, level, flag) Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]") diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index bd4fa98af53..8f936e59f5c 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -54,7 +54,8 @@ var/list/admin_verbs_admin = list( /client/proc/cmd_admin_direct_narrate, /*send text directly to a player with no padding. Useful for narratives and fluff-text*/ /client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/ /client/proc/cmd_admin_create_centcom_report, - /client/proc/check_words /*displays cult-words*/ + /client/proc/check_words, /*displays cult-words*/ + /client/proc/free_slot /*frees slot for chosen job*/ ) var/list/admin_verbs_ban = list( /client/proc/unban_panel, @@ -727,3 +728,19 @@ var/list/admin_verbs_mod = list( if(holder) holder.PlayerNotes() return + +/client/proc/free_slot() + set name = "Free Job Slot" + set category = "Admin" + if(holder) + var/list/jobs = list() + for (var/datum/job/J in job_master.occupations) + if (J.current_positions >= J.total_positions && J.total_positions != -1) + jobs += J.title + if (!jobs.len) + usr << "There are no fully staffed jobs." + return + var/job = input("Please select job slot to free", "Free job slot") as null|anything in jobs + if (job) + job_master.FreeRole(job) + return \ No newline at end of file