diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm index 2427c1cc170..aff4dea38c8 100644 --- a/code/__DEFINES/role_preferences.dm +++ b/code/__DEFINES/role_preferences.dm @@ -50,3 +50,8 @@ var/global/list/special_roles = list( ROLE_DEVIL = /datum/game_mode/devil, ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult, ) + +//Job defines for what happens when you fail to qualify for any job during job selection +#define BEASSISTANT 1 +#define BERANDOMJOB 2 +#define RETURNTOLOBBY 3 \ No newline at end of file diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm index f4925cba6d1..dace889c847 100644 --- a/code/controllers/subsystem/jobs.dm +++ b/code/controllers/subsystem/jobs.dm @@ -328,7 +328,7 @@ var/datum/subsystem/job/SSjob for(var/mob/new_player/player in unassigned) if(PopcapReached()) RejectPlayer(player) - else if(player.client.prefs.userandomjob) + else if(player.client.prefs.joblessrole == BERANDOMJOB) GiveRandomJob(player) Debug("DO, Standard Check end") @@ -339,8 +339,15 @@ var/datum/subsystem/job/SSjob for(var/mob/new_player/player in unassigned) if(PopcapReached()) RejectPlayer(player) - Debug("AC2 Assistant located, Player: [player]") - AssignRole(player, "Assistant") + if(player.client.prefs.joblessrole == BEASSISTANT) + Debug("AC2 Assistant located, Player: [player]") + AssignRole(player, "Assistant") + else // For those who don't want to play if their preference were filled, back you go. + RejectPlayer(player) + + for(var/mob/new_player/player in unassigned) //Players that wanted to back out but couldn't because they're antags (can you feel the edge case?) + GiveRandomJob(player) + return 1 //Gives the player the stuff he should have with his rank @@ -470,7 +477,8 @@ var/datum/subsystem/job/SSjob /datum/subsystem/job/proc/RejectPlayer(mob/new_player/player) if(player.mind && player.mind.special_role) return - Debug("Popcap overflow Check observer located, Player: [player]") + if(PopcapReached()) + Debug("Popcap overflow Check observer located, Player: [player]") player << "You have failed to qualify for any job you desired." unassigned -= player player.ready = 0 diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index c3747346a01..8af3c2bdfb2 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -78,7 +78,7 @@ var/list/preferences_datums = list() var/job_engsec_low = 0 // Want randomjob if preferences already filled - Donkie - var/userandomjob = 1 //defaults to 1 for fewer assistants + var/joblessrole = BERANDOMJOB //defaults to 1 for fewer assistants // 0 = character settings, 1 = game preferences var/current_tab = 0 @@ -551,7 +551,12 @@ var/list/preferences_datums = list() HTML += "" - HTML += "

[userandomjob ? "Get random job if preferences unavailable" : "Be an Assistant if preference unavailable"]
" + var/message = "Be an Assistant if preferences unavailable" + if(joblessrole == BERANDOMJOB) + message = "Get random job if preferences unavailable" + else if(joblessrole == RETURNTOLOBBY) + message = "Return to lobby if preferences unavailable" + HTML += "

[message]
" HTML += "
Reset Preferences
" user << browse(null, "window=preferences") @@ -726,10 +731,16 @@ var/list/preferences_datums = list() ResetJobs() SetChoices(user) if("random") - if(jobban_isbanned(user, "Assistant")) - userandomjob = 1 - else - userandomjob = !userandomjob + switch(joblessrole) + if(RETURNTOLOBBY) + if(jobban_isbanned(user, "Assistant")) + joblessrole = BERANDOMJOB + else + joblessrole = BEASSISTANT + if(BEASSISTANT) + joblessrole = BERANDOMJOB + if(BERANDOMJOB) + joblessrole = RETURNTOLOBBY SetChoices(user) if("setJobLevel") UpdateJobPreference(user, href_list["text"], text2num(href_list["level"])) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 50f2154ef23..9bc900a61cf 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -346,7 +346,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["deity_name"] >> custom_names["deity"] //Jobs - S["userandomjob"] >> userandomjob + S["joblessrole"] >> joblessrole S["job_civilian_high"] >> job_civilian_high S["job_civilian_med"] >> job_civilian_med S["job_civilian_low"] >> job_civilian_low @@ -398,7 +398,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car features["spines"] = sanitize_inlist(features["spines"], spines_list) features["body_markings"] = sanitize_inlist(features["body_markings"], body_markings_list) - userandomjob = sanitize_integer(userandomjob, 0, 1, initial(userandomjob)) + joblessrole = sanitize_integer(joblessrole, 1, 3, initial(joblessrole)) job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high)) job_civilian_med = sanitize_integer(job_civilian_med, 0, 65535, initial(job_civilian_med)) job_civilian_low = sanitize_integer(job_civilian_low, 0, 65535, initial(job_civilian_low)) @@ -456,7 +456,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["deity_name"] << custom_names["deity"] //Jobs - S["userandomjob"] << userandomjob + S["joblessrole"] << joblessrole S["job_civilian_high"] << job_civilian_high S["job_civilian_med"] << job_civilian_med S["job_civilian_low"] << job_civilian_low