Fix mmfloor & mmbar resetting bug

This commit is contained in:
Claude Brisson
2025-01-19 19:41:28 +01:00
parent 6a33f234e2
commit c3bdbde0be

View File

@@ -330,8 +330,8 @@ fun Pairing.Companion.fromJson(json: Json.Object, default: Pairing?): Pairing {
return when (type) {
SWISS -> Swiss(pairingParams, placementParams)
MAC_MAHON -> MacMahon(pairingParams, placementParams).also { mm ->
mm.mmFloor = json.getInt("mmFloor") ?: -20
mm.mmBar = json.getInt("mmBar") ?: 0
mm.mmFloor = json.getInt("mmFloor") ?: (default as? MacMahon)?.mmFloor ?: -20
mm.mmBar = json.getInt("mmBar") ?: (default as? MacMahon)?.mmBar ?: 0
}
ROUND_ROBIN -> RoundRobin(pairingParams, placementParams)
}