mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-22 06:26:57 +01:00
Merge branch 'bugfix/aro-divide-by-zero' into develop
This commit is contained in:
commit
c8a7575dd2
@ -9,6 +9,7 @@
|
||||
* BUGFIX: `Tournament::calculateBuchholz()` did not return the correct score when player had unplayed rounds
|
||||
* BUGFIX: `Tournament::calculateMutualResult()` returned NULL if result was invalid
|
||||
* BUGFIX: `Tournament::calculateBaumbach()` treated bye as won
|
||||
* BUGFIX: `Tournament::calculateAverageRating()` returned NaN if no games were played
|
||||
|
||||
## v1.1.2 (Release: 21-jun-2019)
|
||||
* ENHANCEMENT: Added update section to dist/readme.md
|
||||
|
@ -650,7 +650,11 @@ class Tournament
|
||||
}
|
||||
sort($allratings);
|
||||
$allratings = array_slice($allratings, $cut);
|
||||
return round(array_sum($allratings) / count($allratings));
|
||||
$tiebreak = 0;
|
||||
if (count($allratings) > 0) {
|
||||
$tiebreak = round(array_sum($allratings) / count($allratings));
|
||||
}
|
||||
return $tiebreak;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user