From 2d3c7b8d1f5e480f01af2cef36ed1b1377cd81e5 Mon Sep 17 00:00:00 2001 From: Skriv <skrivelese@gmail.com> Date: Wed, 15 May 2019 20:42:10 +0200 Subject: [PATCH] suggested changes --- src/interaction/main/mainLinks.js | 6 ++---- src/js/assayJS.js | 2 +- src/js/datatypeCleanupJS.js | 2 +- src/js/storyJS.js | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/interaction/main/mainLinks.js b/src/interaction/main/mainLinks.js index 7bcbe2eeec6..80a9153ca67 100644 --- a/src/interaction/main/mainLinks.js +++ b/src/interaction/main/mainLinks.js @@ -120,9 +120,8 @@ App.UI.View.MainLinks = function () { return (typeof organ === 'object' && getSlave(organ.ID) !== undefined); }); /* cycle through slaves, for each slave cycle through completed organs and track how many are of the interrogated slave (and if organs have a slaves to be implanted on) */ - let slaveOrgans; for (let i = 0; i < V.slaves.length; i++) { - slaveOrgans = 0; + let slaveOrgans = 0; V.completedOrgans.forEach(organ => { if (organ.ID === V.slaves[i].ID) { slaveOrgans++; } }); /* if the interrogated slave has one or more organs ready: */ if (slaveOrgans > 0) { @@ -144,10 +143,9 @@ App.UI.View.MainLinks = function () { } if (V.adjustProstheticsCompleted > 0) { - let i; for (let j = 0; j < V.adjustProsthetics.length; j++) { if (getSlave(V.adjustProsthetics[j].slaveID) !== undefined) { - i = V.slaveIndices[V.adjustProsthetics[j].slaveID]; + const i = V.slaveIndices[V.adjustProsthetics[j].slaveID]; if (V.adjustProsthetics[j].workLeft <= 0) { r += `<br><span class="yellow">The lab has completed <<= addA(setup.prosthetics[$adjustProsthetics[${j}].id].name)>> for</span> <span id="name"><<= "[[SlaveFullName($slaves[${i}])|Slave Interact][$activeSlave = $slaves[${i}]]]">>,</span> <span class="yellow"> which is ready to be attached.</span>`; } diff --git a/src/js/assayJS.js b/src/js/assayJS.js index 8ce6ec6e4f7..85d9c11a4b1 100644 --- a/src/js/assayJS.js +++ b/src/js/assayJS.js @@ -334,7 +334,7 @@ window.getSlave = function getSlave(ID) { }; window.getChild = function getChild(ID) { - return State.variables.cribs.find(function(s) {return s.ID === ID;}); + return State.variables.cribs.find(s => s.ID === ID); }; App.Utils.Pronouns = class { diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js index d7d1b74d67f..6162fb2eb6d 100644 --- a/src/js/datatypeCleanupJS.js +++ b/src/js/datatypeCleanupJS.js @@ -201,7 +201,7 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { /** * @param {App.Entity.SlaveState} slave - * @param {boolean} isIncubatorSlave + * @param {boolean} [isIncubatorSlave] */ function SlaveDatatypeCleanup(slave, isIncubatorSlave = false) { V = State.variables; diff --git a/src/js/storyJS.js b/src/js/storyJS.js index 220445a9529..feee5723793 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -430,10 +430,10 @@ window.toJson = function(obj) { }; /** - * @param {App.Entity.SlaveState} [slave] + * @param {App.Entity.SlaveState} slave * @returns {string} */ -window.nippleColor = function(slave = State.variables.activeSlave) { +window.nippleColor = function (slave) { if (skinToneLevel(slave.skin) < 8) { if (slave.preg > slave.pregData.normalBirth / 4 || (slave.counter.birthsTotal > 0 && slave.lactation > 0)) { return "brown"; -- GitLab