diff --git a/src/descriptions/familySummaries.js b/src/descriptions/familySummaries.js index 6b82150d8d88a0465cb8679dedb6faa3c8e2789d..66defe224a4621f7e422beb5bfece1521bc29bf4 100644 --- a/src/descriptions/familySummaries.js +++ b/src/descriptions/familySummaries.js @@ -31,7 +31,7 @@ App.Desc.family = (function() { /** Splits an array of slaves by sex (nieces/nephews, aunts/uncles, brothers/sisters, etc) * @param {Array<App.Entity.SlaveState>} slaves - * @returns {Object} + * @returns {{m: Array<App.Entity.SlaveState>, f: Array<App.Entity.SlaveState>}} */ function splitBySex(slaves) { let r = {m: [], f: []}; @@ -226,7 +226,7 @@ App.Desc.family = (function() { /* PC aunt and uncle - determines how many aunts and uncles you have */ if (isAunt(V.PC, slave)) { - const {m: uncles, f: aunts} = splitBySex(V.slaves.filter((s) => isAunt(V.PC, s))); + const {m: uncles, f: aunts} = splitBySex(V.slaves.filter((s) => s.ID !== slave.ID && isAunt(V.PC, s))); r.push(`${He} is`); if (slave.genes === "XX") { @@ -270,7 +270,7 @@ App.Desc.family = (function() { /* PC niece and nephew - determines how many nieces and nephews you have*/ if (isAunt(slave, V.PC)) { - const {m: nephews, f: nieces} = splitBySex(V.slaves.filter((s) => isAunt(s, V.PC))); + const {m: nephews, f: nieces} = splitBySex(V.slaves.filter((s) => s.ID !== slave.ID && isAunt(s, V.PC))); r.push(`${He} is`); if (slave.genes === "XX") { @@ -450,7 +450,7 @@ App.Desc.family = (function() { if (V.showDistantRelatives) { /* PC cousin - determines how many cousins you have*/ if (areCousins(slave, V.PC)) { - const PCcousins = V.slaves.filter((s) => areCousins(V.PC, s)); + const PCcousins = V.slaves.filter((s) => s.ID !== slave.ID && areCousins(V.PC, s)); r.push(`${He} is`); if (PCcousins.length > 0) { r.push(`<span class="lightgreen">your cousin along with ${slaveListToText(PCcousins)}.</span>`);