From 3e6f641ec3a182c2198e5fa35b3bcda66773cde8 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sat, 24 Oct 2015 19:46:44 -0400 Subject: [PATCH] Should fix loading from jobs.txt The jobs controller's list of occupations was reset during roundstart which completely undid that whole load from file thing. It also would have undone any admin edits done while sitting in the lobby. Also fixed a couple instances where people thought that lists get copied with the = operator instead of passing by reference. --- code/controllers/subsystem/jobs.dm | 5 ++--- code/game/gamemodes/abduction/abduction.dm | 2 +- code/modules/mob/interactive.dm | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm index 743d799374f..e225242826f 100644 --- a/code/controllers/subsystem/jobs.dm +++ b/code/controllers/subsystem/jobs.dm @@ -202,7 +202,6 @@ var/datum/subsystem/job/SSjob /datum/subsystem/job/proc/DivideOccupations() //Setup new player list and get the jobs list Debug("Running DO") - SetupOccupations() //Holder for Triumvirate is stored in the ticker, this just processes it if(ticker) @@ -397,8 +396,8 @@ var/datum/subsystem/job/SSjob for(var/datum/job/J in occupations) var/regex = "[J.title]=(-1|\\d+),(-1|\\d+)" var/datum/regex/results = regex_find(jobstext, regex) - J.total_positions = results.str(2) - J.spawn_positions = results.str(3) + J.total_positions = text2num(results.str(2)) + J.spawn_positions = text2num(results.str(3)) /datum/subsystem/job/proc/HandleFeedbackGathering() for(var/datum/job/job in occupations) diff --git a/code/game/gamemodes/abduction/abduction.dm b/code/game/gamemodes/abduction/abduction.dm index 1151de4f55f..4321082c0aa 100644 --- a/code/game/gamemodes/abduction/abduction.dm +++ b/code/game/gamemodes/abduction/abduction.dm @@ -357,7 +357,7 @@ explanation_text = "Capture" /datum/objective/abductee/capture/New() - var/list/jobs = SSjob.occupations + var/list/jobs = SSjob.occupations.Copy() for(var/datum/job/J in jobs) if(J.current_positions < 1) jobs -= J diff --git a/code/modules/mob/interactive.dm b/code/modules/mob/interactive.dm index 51cb52ac775..62f825ea056 100644 --- a/code/modules/mob/interactive.dm +++ b/code/modules/mob/interactive.dm @@ -88,7 +88,7 @@ //this is here because this has no client/prefs/brain whatever. age = rand(AGE_MIN,AGE_MAX) //job handling - var/list/jobs = SSjob.occupations + var/list/jobs = SSjob.occupations.Copy() for(var/datum/job/J in jobs) if(J.title == "Cyborg" || J.title == "AI" || J.title == "Chaplain" || J.title == "Mime") jobs -= J