Bugfix: at H-2, 1h should become 0.

This commit is contained in:
Claude Brisson
2024-04-11 16:23:44 +02:00
parent c9be8b6d76
commit 704906dd90

View File

@@ -513,7 +513,8 @@ sealed class BaseSolver(
open fun HandicapParams.clamp(input: Int): Int { open fun HandicapParams.clamp(input: Int): Int {
var hd = input var hd = input
if (hd >= correction) hd -= correction if (hd >= correction) hd -= correction
if (hd < 0) hd = max(hd + correction, 0) else if (hd < 0) hd = max(hd + correction, 0)
else hd = 0
// Clamp handicap with ceiling // Clamp handicap with ceiling
hd = min(hd, ceiling) hd = min(hd, ceiling)
hd = max(hd, -ceiling) hd = max(hd, -ceiling)