From 8be10645a8f72071d5610d4da48362de58a44315 Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Wed, 31 Jul 2024 11:04:20 +0200 Subject: [PATCH] Fix handicap calculation --- .../kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt index db55e3d..699e388 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/pairing/solver/BaseSolver.kt @@ -487,7 +487,8 @@ sealed class BaseSolver( var hd = input // TODO - validate that "correction" is >= 0 (or modify the UI and the following code to handle the <0 case) if (hd >= correction) hd -= correction - else if (hd < 0) hd = max(hd + correction, 0) + // TODO - Following line seems buggy... Get rid of it! What as the purpose?! + // else if (hd < 0) hd = max(hd + correction, 0) else hd = 0 // Clamp handicap with ceiling hd = min(hd, ceiling)