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.
This commit is contained in:
Jeroen De Meerleer 2024-08-21 17:25:05 +02:00
parent 2d9fbe8433
commit ff8d372a8f

View File

@ -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);
}
}