Fixed use of Points

This commit is contained in:
Jeroen De Meerleer 2019-12-21 19:32:53 +01:00
parent 9cda048633
commit c3170846c6
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 3 additions and 3 deletions

View File

@ -786,7 +786,7 @@ class Tournament
{ {
$tiebreak = 0; $tiebreak = 0;
foreach ($player->Pairings as $plkey => $plpairing) { foreach ($player->Pairings as $plkey => $plpairing) {
if (($plpairing->Opponent->Points / count($plpairing->Opponent->Pairings) * 100) >= $cut) { if (($plpairing->Opponent->calculatePoints() / count($plpairing->Opponent->Pairings) * 100) >= $cut) {
if (array_search($plpairing->Result, Constants::Won) !== false) { if (array_search($plpairing->Result, Constants::Won) !== false) {
$tiebreak += 1; $tiebreak += 1;
} elseif (array_search($plpairing->Result, Constants::Draw) !== false) { } elseif (array_search($plpairing->Result, Constants::Draw) !== false) {
@ -856,9 +856,9 @@ class Tournament
foreach ($player->Pairings as $key => $pairing) { foreach ($player->Pairings as $key => $pairing) {
if ($pairing->Opponent) { if ($pairing->Opponent) {
if (array_search($pairing->Result, Constants::Won) !== false) { if (array_search($pairing->Result, Constants::Won) !== false) {
$tiebreak += $pairing->Opponent->Points; $tiebreak += $pairing->Opponent->calculatePoints();
} elseif (array_search($pairing->Result, Constants::Draw) !== false) { } elseif (array_search($pairing->Result, Constants::Draw) !== false) {
$tiebreak += $pairing->Opponent->Points / 2; $tiebreak += $pairing->Opponent->calculatePoints() / 2;
} }
} }
} }