diff --git a/src/js/familyTreeJS.js b/src/js/familyTreeJS.js index 35e7cf1753dc1594c32f81e05d790588aba71624..9c0f6eeae0c39db373aa990ac9ef81f128fd409e 100644 --- a/src/js/familyTreeJS.js +++ b/src/js/familyTreeJS.js @@ -269,17 +269,19 @@ window.buildFamilyTree = function(slaves, filterID) { let mom = character.mother; if (mom < -6) { if (mom in State.variables.missingTable && State.variables.showMissingSlaves) { - node_lookup[mom] = family_graph.nodes.length; - let missing = State.variables.missingTable[mom]; - charList.push({ - ID: mom, - mother: 0, - father: 0, - is_mother: true, - dick: missing.dick, - vagina: missing.vagina, - slaveName: missing.slaveName - }); + if (typeof node_lookup[mom] === 'undefined') { + node_lookup[mom] = family_graph.nodes.length; + let missing = State.variables.missingTable[mom]; + charList.push({ + ID: mom, + mother: 0, + father: 0, + is_mother: true, + dick: missing.dick, + vagina: missing.vagina, + slaveName: missing.slaveName + }); + } } else { if (typeof outmoms[mom] === 'undefined') { outmoms[mom] = []; @@ -302,17 +304,19 @@ window.buildFamilyTree = function(slaves, filterID) { let dad = character.father; if (dad < -6) { if (dad in State.variables.missingTable && State.variables.showMissingSlaves) { - node_lookup[dad] = family_graph.nodes.length; - let missing = State.variables.missingTable[dad]; - charList.push({ - ID: dad, - mother: 0, - father: 0, - is_father: true, - dick: missing.dick, - vagina: missing.vagina, - slaveName: missing.slaveName - }); + if (typeof node_lookup[dad] === 'undefined') { + node_lookup[dad] = family_graph.nodes.length; + let missing = State.variables.missingTable[dad]; + charList.push({ + ID: dad, + mother: 0, + father: 0, + is_father: true, + dick: missing.dick, + vagina: missing.vagina, + slaveName: missing.slaveName + }); + } } else { if (typeof outdads[dad] === 'undefined') { outdads[dad] = []; @@ -446,11 +450,13 @@ window.buildFamilyTree = function(slaves, filterID) { for (let i = 0; i < charList.length; i++) { let character = charList[i]; let char_id = character.ID; - if (character.mother === 0 && character.father === 0 && !kids[char_id]) { - continue; - } - if (filterID && !related[char_id]) { - continue; + if (char_id !== filterID) { + if (character.mother === 0 && character.father === 0 && !kids[char_id]) { + continue; + } + if (filterID && !related[char_id]) { + continue; + } } node_lookup[char_id] = family_graph.nodes.length; let char_obj = {