diff --git a/code/modules/client/preference_setup/occupation/occupation.dm b/code/modules/client/preference_setup/occupation/occupation.dm index 4093b45c6aa..59446ae37e5 100644 --- a/code/modules/client/preference_setup/occupation/occupation.dm +++ b/code/modules/client/preference_setup/occupation/occupation.dm @@ -287,15 +287,26 @@ ResetJobs() return TOPIC_REFRESH_UPDATE_PREVIEW + var/datum/species/S = pref.get_species_datum() var/datum/faction/faction = SSjobs.name_factions[pref.faction] - for(var/datum/job/job in faction.get_occupations()) + for(var/datum/job/job in SSjobs.occupations) for(var/department = 1 to NUM_JOB_DEPTS) if(pref.GetJobDepartment(job, department) & job.flag) + if(!(job in faction.get_occupations())) + to_client_chat(SPAN_DANGER("Your faction selection does not permit this job, [job.title] as [pref.faction].")) + to_client_chat(SPAN_DANGER("Your jobs have been reset due to this!")) + ResetJobs() + return TOPIC_REFRESH_UPDATE_PREVIEW if(pref.species in job.blacklisted_species) to_client_chat(SPAN_DANGER("Your faction selection does not permit this species-occupation combination, [pref.species] as [job.title].")) to_client_chat(SPAN_DANGER("Your jobs have been reset due to this!")) ResetJobs() return TOPIC_REFRESH_UPDATE_PREVIEW + if(!is_type_in_typecache(S, faction.allowed_species_types)) + to_client_chat(SPAN_DANGER("Your faction selection does not permit this species, [pref.species] as [pref.faction].")) + to_client_chat(SPAN_DANGER("Your jobs have been reset due to this!")) + ResetJobs() + return TOPIC_REFRESH_UPDATE_PREVIEW /datum/category_item/player_setup_item/occupation/proc/SetPlayerAltTitle(datum/job/job, new_title) // remove existing entry diff --git a/html/changelogs/JobFix.yml b/html/changelogs/JobFix.yml new file mode 100644 index 00000000000..fb512499696 --- /dev/null +++ b/html/changelogs/JobFix.yml @@ -0,0 +1,6 @@ +author: TheGreyWolf + +delete-after: True + +changes: + - bugfix: "The job code now checks if a given job & species preference is permitted for a given faction when loading a character."