Merge pull request #9302 from deathride58/jobcodesanitychecks

fixes roundstart runtimes by job_preferences index checks be explicit key checks instead, plus some extra sanity checks
This commit is contained in:
kevinz000
2019-09-17 22:00:59 -07:00
committed by GitHub
4 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -105,7 +105,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
else if(job_engsec_low & fval)
new_value = JP_LOW
if(new_value)
job_preferences[initial(J.title)] = new_value
job_preferences["[initial(J.title)]"] = new_value
else if(current_version < 23) // we are fixing a gamebreaking bug.
job_preferences = list() //It loaded null from nonexistant savefile field.
@@ -489,7 +489,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
joblessrole = sanitize_integer(joblessrole, 1, 3, initial(joblessrole))
//Validate job prefs
for(var/j in job_preferences)
if(job_preferences[j] != JP_LOW && job_preferences[j] != JP_MEDIUM && job_preferences[j] != JP_HIGH)
if(job_preferences["[j]"] != JP_LOW && job_preferences["[j]"] != JP_MEDIUM && job_preferences["[j]"] != JP_HIGH)
job_preferences -= j
all_quirks = SANITIZE_LIST(all_quirks)