Skip to content
Snippets Groups Projects
Commit f1f2aa5c authored by Empress Sela's avatar Empress Sela
Browse files

Fix fathers not being added to missing table in NGP

parent 7a51e5b7
No related branches found
No related tags found
1 merge request!7156Inbreeding coefficient
......@@ -78,6 +78,13 @@ App.Data.NewGamePlus = (function() {
if (needed.indexOf(i) === -1)
needed.push(i);
})));
(V.slaves || []).forEach(s => (s.womb
.forEach(f => ([f.fatherID, f.genetics.father, f.genetics.mother]
.filter(i => (i in missingTable))
.forEach(i => {
if (needed.indexOf(i) === -1)
needed.push(i);
})))));
while (needed.length > 0) {
let i = needed.shift();
......@@ -113,11 +120,19 @@ App.Data.NewGamePlus = (function() {
father: s.father,
inbreedingCoeff: s.inbreedingCoeff
};
Object.values(V.missingTable).concat(V.slaves).forEach(so => {
Object.values(V.missingTable).forEach(so => {
if (so.mother === s.ID)
so.mother = oldMissingParentID;
if (so.father === s.ID)
so.father = oldMissingParentID;
});
V.slaves.filter(so => (so.assignment === Job.IMPORTED)).forEach(so => {
if (so.mother === s.ID)
so.mother = oldMissingParentID;
if (so.father === s.ID)
so.father = oldMissingParentID;
WombChangeID(so, s.ID, oldMissingParentID);
WombChangeGeneID(so, s.ID, oldMissingParentID);
});
oldMissingParentID--;
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment