diff --git a/src/facilities/incubator/incubatorInteract.js b/src/facilities/incubator/incubatorInteract.js index 7ef9c5be957c3b549b1b1cd9881a98c42d90103f..91e9b6ef0d29dabc428d82a288ac6f4618734516 100644 --- a/src/facilities/incubator/incubatorInteract.js +++ b/src/facilities/incubator/incubatorInteract.js @@ -6,7 +6,6 @@ App.UI.incubator = function() { V.readySlaves = 0; V.readySlave = 0; - let tankOrgans = {}; const el = new DocumentFragment(); const _SL = V.slaves.length; let childrenReserved; @@ -924,6 +923,7 @@ App.UI.incubator = function() { V.tanks[i].slaveName, (v) => { V.tanks[i].slaveName = v; + V.tanks[i].birthName = V.tanks[i].slaveName; refresh(); } ) @@ -950,7 +950,7 @@ App.UI.incubator = function() { if ((V.incubatorUpgradeOrgans === 1) && (V.tanks[i].tankBaby !== 3)) { r = []; r.push(`You can extract a sample and prepare a new organ for ${him} to be implanted once ${he} exits ${his} tank.`); - tankOrgans = { + const tankOrgans = { ovaries: 0, penis: 0, testicles: 0, @@ -958,26 +958,9 @@ App.UI.incubator = function() { leftEye: 0, voiceBox: 0 }; - for (let _i = 0; _i < V.incubatorOrgans.length; _i++) { - if (V.tanks[i].ID === V.incubatorOrgans[_i].ID) { - if (V.incubatorOrgans[_i].type === "ovaries") { - tankOrgans.ovaries = 1; - } - if (V.incubatorOrgans[_i].type === "testicles") { - tankOrgans.testicles = 1; - } - if (V.incubatorOrgans[_i].type === "penis") { - tankOrgans.penis = 1; - } - if (V.incubatorOrgans[_i].type === "rightEye") { - tankOrgans.rightEye = 1; - } - if (V.incubatorOrgans[_i].type === "leftEye") { - tankOrgans.leftEye = 1; - } - if (V.incubatorOrgans[_i].type === "voicebox") { - tankOrgans.voicebox = 1; - } + for (const organ of V.incubatorOrgans) { + if (V.tanks[i].ID === organ.ID) { + tankOrgans[organ.type] = 1; } }