diff --git a/src/js/assayJS.tw b/src/js/assayJS.tw index 56a9667e890841ae9f1c6e9b5f52e0cac3b30444..96248f2c3e535df4682b0c09a81d286311d11f65 100644 --- a/src/js/assayJS.tw +++ b/src/js/assayJS.tw @@ -217,22 +217,22 @@ window.inferiorRaceP = function inferiorRaceP(slave) { window.addSlave = function addSlave(slave) { State.variables.slaves.push(slave); - State.variables.slaveIndices[slave.id] = State.variables.slaves.length - 1; + State.variables.slaveIndices[slave.ID] = State.variables.slaves.length - 1; }; window.removeSlave = function removeSlave(index) { - delete State.variables.slaveIndices[State.variables.slaves[index].id]; + delete State.variables.slaveIndices[State.variables.slaves[index].ID]; return State.variables.slaves.deleteAt(index); }; window.slaves2indices = function slaves2indices() { const obj = {}; - State.variables.slaves.forEach((slave, i) => obj[slave.id] = i); + State.variables.slaves.forEach((slave, i) => obj[slave.ID] = i); return obj; }; window.getSlave = function getSlave(ID) { const index = State.variables.slaveIndices[ID]; if (index === undefined) return null; - else return State.variables.slaves[State.variables.slaveIndices[ID]]; + else return State.variables.slaves[index]; }; diff --git a/src/js/fresult.tw b/src/js/fresult.tw index 22141b5042510ce5158ded803c364ff0d3e43d1e..d46c9ece3da9aad09046c15673049a70285ae9fa 100644 --- a/src/js/fresult.tw +++ b/src/js/fresult.tw @@ -92,7 +92,7 @@ window.FResult = (function() { function calcWorksWithRelativesVanilla(slave) { const fre = getSlave(slave.relationTarget) - if (free !== null && sameAssignmentP(slave, fre)) + if (fre !== null && sameAssignmentP(slave, fre)) { V.FResult += 2; if (incest_bonus) V.FResult += 2; }