From ff8d372a8f5bdb940795e8461045922658de7f37 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Wed, 21 Aug 2024 17:25:05 +0200 Subject: [PATCH] Updated point calculation for Swiss system The point calculation for virtual players and tiebreaks has been updated to only apply when the tournament system is set to Swiss. This change ensures that points are calculated correctly based on the specific rules of each tournament system. --- src/Tournament.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tournament.php b/src/Tournament.php index b323b7c..aa29f5f 100644 --- a/src/Tournament.php +++ b/src/Tournament.php @@ -525,7 +525,7 @@ class Tournament foreach ($intpairingsWithBye as $key => $pairing) { $roundstoplay = (count($intpairingsWithBye)) - $curround; if (is_null($pairing->Opponent)) { - $intpairings[] = $player->calculatePointsForVirtualPlayer($key); + if($this->System == TournamentSystem::SWISS) $intpairings[] = $player->calculatePointsForVirtualPlayer($key); } else { $intpairings[] = $pairing->Opponent->calculatePointsForTiebreaks(); if (array_search($pairing->Result, Constants::WON) !== false) { @@ -730,7 +730,7 @@ class Tournament } } if ($pairing->Result == Result::WON_BYE) { - $tiebreak += $player->calculatePointsForVirtualPlayer($key); + if($this->System == TournamentSystem::SWISS) $tiebreak += $player->calculatePointsForVirtualPlayer($key); } }