diff --git a/src/js/assignJS.js b/src/js/assignJS.js index c982ce28d5b7b131388631415a72d303b57bc889..073941522aadba22e1b31967b916aed75c56f5ea 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -24,34 +24,32 @@ window.assignJob = function assignJob(slave, job) { }; /* Tracking for the following cases: */ - if (V.assignmentRecords[slave.ID] !== "choose her own job") { // if choosesOwnAssignment was set before removeJob, it's saved in assignmentRecords. We don't want to overwrite that here, as we want to be able to get it back. - if (oldJob !== job && V.assignmentRecords[slave.ID] !== job && oldJob !== "rest") { // Check that there is a real change happening. Sometimes when you send someone to a classroom or something, this fires twice. - switch (job.toLowerCase()) { - case "be confined in the cellblock": - case "cellblock": - if (oldJob !== "be confined in the cellblock") { // Due to the way assignJob fires twice on assigning to a building, we have to make sure that we are keeping the original record. - V.assignmentRecords[slave.ID] = oldJob; - } - break; - case "get treatment in the clinic": - case "clinic": - if (oldJob !== "get treatment in the clinic") { - V.assignmentRecords[slave.ID] = oldJob; - } - break; - case "learn in the schoolroom": - case "schoolroom": - if (oldJob !== "learn in the schoolroom") { - V.assignmentRecords[slave.ID] = oldJob; - } - break; - case "rest in the spa": - case "spa": - if (oldJob !== "rest in the spa") { - V.assignmentRecords[slave.ID] = oldJob; - } - break; - } + if (oldJob !== job && V.assignmentRecords[slave.ID] !== job && oldJob !== "rest") { // Check that there is a real change happening. Sometimes when you send someone to a classroom or something, this fires twice. + switch (job.toLowerCase()) { + case "be confined in the cellblock": + case "cellblock": + if (oldJob !== "be confined in the cellblock") { // Due to the way assignJob fires twice on assigning to a building, we have to make sure that we are keeping the original record. + V.assignmentRecords[slave.ID] = oldJob; + } + break; + case "get treatment in the clinic": + case "clinic": + if (oldJob !== "get treatment in the clinic") { + V.assignmentRecords[slave.ID] = oldJob; + } + break; + case "learn in the schoolroom": + case "schoolroom": + if (oldJob !== "learn in the schoolroom") { + V.assignmentRecords[slave.ID] = oldJob; + } + break; + case "rest in the spa": + case "spa": + if (oldJob !== "rest in the spa") { + V.assignmentRecords[slave.ID] = oldJob; + } + break; } } /* use .toLowerCase() to get rid of a few dupe conditions. */ @@ -650,10 +648,6 @@ window.removeJob = function removeJob(slave, assignment, saveRecord) { slave.rules.living = "normal"; } - if (slave.choosesOwnAssignment > 0) { - V.assignmentRecords[slave.ID] = "choose her own job"; - } - slave.choosesOwnAssignment = 0; slave.sentence = 0; slave.subTarget = 0;