[MIRROR] Overhauls job eligibility checking and improves job debug logging. [MDB IGNORE] (#9348)

* Overhauls job eligibility checking and improves job debug logging.

* Fixing conflicts

* Makes Veteran the first check since it's the most likely.

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
This commit is contained in:
SkyratBot
2021-11-10 21:39:42 +00:00
committed by GitHub
parent ec31da7756
commit 08bd01ea3d
5 changed files with 203 additions and 163 deletions
+12 -11
View File
@@ -150,15 +150,17 @@
if(JOB_UNAVAILABLE_SLOTFULL)
return "[jobtitle] is already filled to capacity."
//SKYRAT EDIT ADDITION
if(JOB_NOT_VETERAN)
return "You need to be veteran to join as [jobtitle]."
if(JOB_UNAVAILABLE_QUIRK)
return "[jobtitle] is restricted from your quirks."
if(JOB_UNAVAILABLE_LANGUAGE)
return "[jobtitle] is restricted from your languages."
if(JOB_NOT_VETERAN)
return "You need to be veteran to join as [jobtitle]."
if(JOB_UNAVAILABLE_SPECIES)
return "[jobtitle] is restricted from your species."
//SKYRAT EDIT END
if(JOB_UNAVAILABLE_ANTAG_INCOMPAT)
return "[jobtitle] is not compatible with some antagonist role assigned to you."
return "Error: Unknown job availability."
/mob/dead/new_player/proc/IsJobUnavailable(rank, latejoin = FALSE)
@@ -174,14 +176,11 @@
return JOB_UNAVAILABLE_SLOTFULL
else
return JOB_UNAVAILABLE_SLOTFULL
if(is_banned_from(ckey, rank))
return JOB_UNAVAILABLE_BANNED
if(QDELETED(src))
return JOB_UNAVAILABLE_GENERIC
if(!job.player_old_enough(client))
return JOB_UNAVAILABLE_ACCOUNTAGE
if(job.required_playtime_remaining(client))
return JOB_UNAVAILABLE_PLAYTIME
var/eligibility_check = SSjob.check_job_eligibility(src, job, "Mob IsJobUnavailable")
if(eligibility_check != JOB_AVAILABLE)
return eligibility_check
if(latejoin && !job.special_check_latejoin(client))
return JOB_UNAVAILABLE_GENERIC
//SKYRAT EDIT ADDITION
@@ -217,7 +216,9 @@
var/datum/job/job = SSjob.GetJob(rank)
SSjob.AssignRole(src, job, TRUE)
if(!SSjob.AssignRole(src, job, TRUE))
tgui_alert(usr, "There was an unexpected error putting you into your requested job. If you cannot join with any job, you should contact an admin.")
return FALSE
mind.late_joiner = TRUE
var/atom/destination = mind.assigned_role.get_latejoin_spawn_point()