From f1161a6d1ec646eec79e2044f7828eebb45ac23a Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 27 Sep 2023 08:18:59 +0200 Subject: [PATCH] [MIRROR] Fixes some more issues with job configs not being loaded by ResetOccupation [MDB IGNORE] (#23936) * Fixes some more issues with job configs not being loaded by ResetOccupation (#78596) ## About The Pull Request Job configs would get reset by ResetOccupation and not loaded afterwards. This fixes that. ## Why It's Good For The Game Bugfix ## Changelog :cl: fix: Fixed job configs not being loaded properly. /:cl: --------- Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com> * Fixes some more issues with job configs not being loaded by ResetOccupation --------- Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com> --- code/controllers/configuration/entries/jobs.dm | 5 +++-- code/controllers/subsystem/job.dm | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/code/controllers/configuration/entries/jobs.dm b/code/controllers/configuration/entries/jobs.dm index 99a3ab7a701..06563e01a8e 100644 --- a/code/controllers/configuration/entries/jobs.dm +++ b/code/controllers/configuration/entries/jobs.dm @@ -9,7 +9,7 @@ return returnable_list /// Sets all of the job datum configurable values to what they've been set to in the config file, jobconfig.toml. -/datum/controller/subsystem/job/proc/load_jobs_from_config() +/datum/controller/subsystem/job/proc/load_jobs_from_config(silent = FALSE) if(!length(job_config_datum_singletons)) stack_trace("SSjob tried to load jobs from config, but the config singletons were not initialized! Likely tried to load jobs before SSjob was initialized.") return @@ -25,7 +25,8 @@ var/job_key = occupation.config_tag if(!job_config[job_key]) // Job isn't listed, skip it. // List both job_title and job_key in case they de-sync over time. - message_admins(span_notice("[occupation.title] (with config key [job_key]) is missing from jobconfig.toml! Using codebase defaults.")) + if(!silent) + message_admins(span_notice("[occupation.title] (with config key [job_key]) is missing from jobconfig.toml! Using codebase defaults.")) continue for(var/config_datum_key in job_config_datum_singletons) diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index 96f391b91eb..976b4bab249 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -305,8 +305,10 @@ SUBSYSTEM_DEF(job) player.mind.special_role = null SetupOccupations() unassigned = list() - if(overflow_role) - set_overflow_role(overflow_role) + if(CONFIG_GET(flag/load_jobs_from_txt)) + // Any errors with the configs has already been said, we don't need to repeat them here. + load_jobs_from_config(silent = TRUE) + set_overflow_role(overflow_role) return