From d9e1e83d742be4b0734b318d9e63d6a7d9230d56 Mon Sep 17 00:00:00 2001 From: "Mr. Stallion" Date: Sun, 4 Oct 2020 16:48:48 -0500 Subject: [PATCH] Fix to scoring logic --- learn/matcher.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/learn/matcher.ts b/learn/matcher.ts index c7943ce..7096981 100644 --- a/learn/matcher.ts +++ b/learn/matcher.ts @@ -183,7 +183,7 @@ export class Matcher { const theirCharacterAnalyses = Matcher.generateAnalysisVariations(them); let bestScore = null; - let bestScoreLevelCount = 10000; + let bestScoreLevelCount = -10000; let bestReport: MatchReport; for(const yourAnalysis of yourCharacterAnalyses) { @@ -209,11 +209,11 @@ export class Matcher { (report.score !== null) && (report.score >= bestScore) && (scoreLevelCount !== null) - && (scoreLevelCount < bestScoreLevelCount) + && (report.score * scoreLevelCount > bestScoreLevelCount) ) ) { bestScore = report.score; - bestScoreLevelCount = (scoreLevelCount !== null) ? scoreLevelCount : 1000; + bestScoreLevelCount = ((scoreLevelCount !== null) && (report.score !== null)) ? report.score * scoreLevelCount : -1000; bestReport = report; } }