From 82a0fabde87133782258e776ad282ccf2b5c08e6 Mon Sep 17 00:00:00 2001 From: Glazelf Date: Wed, 4 Oct 2023 18:18:01 +0200 Subject: [PATCH] add check for family synths including themselves --- util/synthesis.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/synthesis.js b/util/synthesis.js index 19869e8..eab4f5f 100644 --- a/util/synthesis.js +++ b/util/synthesis.js @@ -99,7 +99,7 @@ function synthesisCheck({ pair = [], target = "", parents = [] }) { let parentsVariables = getPairVariables(parents); let targetData = monstersJSON[target]; // Check if fusion between both parents' families by filtering arrays against eachother, also taking into account ranks - let familySynthesisBool = (pair.filter((element) => !parentsVariables.pairAndFamilies.includes(element)).length === 0 && parentsVariables.pairRanks.includes(targetData.rank)); + let familySynthesisBool = (pair.filter((element) => !parentsVariables.pairAndFamilies.includes(element)).length === 0 && parentsVariables.pairRanks.includes(targetData.rank) && !parents.includes(target)); // Check for matching ranks and unmatching family synths // Check if fusion between both at least 1 parent and another parent or family by filtering arrays against eachother, also taking into account one+ parent has to be a species let uniqueSynthesisBool = (pair.filter((element) => !parentsVariables.pairAndFamilies.includes(element)).length === 0 && (pair.filter((element) => !parents.includes(element)).length < 2)); let synthesisType = null;