[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
🆑
fix: Fixed job configs not being loaded properly.
/🆑

---------

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>
This commit is contained in:
SkyratBot
2023-09-27 08:18:59 +02:00
committed by GitHub
parent efa5312634
commit f1161a6d1e
2 changed files with 7 additions and 4 deletions

View File

@@ -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,6 +25,7 @@
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.
if(!silent)
message_admins(span_notice("[occupation.title] (with config key [job_key]) is missing from jobconfig.toml! Using codebase defaults."))
continue

View File

@@ -305,7 +305,9 @@ SUBSYSTEM_DEF(job)
player.mind.special_role = null
SetupOccupations()
unassigned = list()
if(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