From 9a539d40a6b6549ce09327fa90408310a6629953 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Thu, 23 Jan 2020 14:49:46 -0500 Subject: [PATCH] ez fix --- src/js/assignJS.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/js/assignJS.js b/src/js/assignJS.js index daceed21118..9551e819aaf 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -17,6 +17,22 @@ window.assignJob = function assignJob(slave, job) { V[propName] = slave; }; + /* Tracking for the following cases: */ + switch (job.toLowerCase()) { + case "be confined in the cellblock": + case "cellblock": + case "get treatment in the clinic": + case "clinic": + case "learn in the schoolroom": + case "schoolroom": + case "rest in the spa": + case "spa": + if (oldJob !== "rest") { + V.assignmentRecords[slave.ID] = oldJob; // these jobs are temporary, so we save what the slave will return to if it is meaningful. + } + break; + } + /* use .toLowerCase() to get rid of a few dupe conditions. */ switch (job.toLowerCase()) { case "be confined in the arcade": @@ -48,9 +64,6 @@ window.assignJob = function assignJob(slave, job) { case "be confined in the cellblock": case "cellblock": - if (oldJob !== "rest") { - V.assignmentRecords[slave.ID] = oldJob; - } slave.assignment = "be confined in the cellblock"; V.CellBiIDs.push(slave.ID); switch (V.cellblockDecoration) { @@ -65,9 +78,6 @@ window.assignJob = function assignJob(slave, job) { case "get treatment in the clinic": case "clinic": - if (oldJob !== "rest") { - V.assignmentRecords[slave.ID] = oldJob; - } slave.assignment = "get treatment in the clinic"; V.CliniciIDs.push(slave.ID); switch (V.clinicDecoration) { @@ -179,9 +189,6 @@ window.assignJob = function assignJob(slave, job) { case "learn in the schoolroom": case "schoolroom": - if (oldJob !== "rest") { - V.assignmentRecords[slave.ID] = oldJob; - } slave.assignment = "learn in the schoolroom"; V.SchlRiIDs.push(slave.ID); slave.rules.living = "normal"; @@ -234,9 +241,6 @@ window.assignJob = function assignJob(slave, job) { case "rest in the spa": case "spa": - if (oldJob !== "rest") { - V.assignmentRecords[slave.ID] = oldJob; - } slave.assignment = "rest in the spa"; V.SpaiIDs.push(slave.ID); switch (V.spaDecoration) { -- GitLab