diff options
Diffstat (limited to 'http/api-inc.php')
-rw-r--r-- | http/api-inc.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/http/api-inc.php b/http/api-inc.php index 67a7fd7..1364195 100644 --- a/http/api-inc.php +++ b/http/api-inc.php @@ -200,8 +200,11 @@ class ApiPkl { for ($place = 1; $place <= $this->parameters['contestants']; $place++) { $percentage = $this->get_percentage_from_position($place, $this->parameters['contestants'], $this->parameters['points_cutoffs']); $points = safe_ceil(floatval($max_points) * $percentage * $scale_factor); - $result['points'][$place] = max($min_points, intval($points)); - $result['sum'] += $this->parameters['type'] * $result['points'][$place]; + $points = max($min_points, intval($points)); + if ($points > 0) { + $result['points'][$place] = $points; + $result['sum'] += $this->parameters['type'] * $result['points'][$place]; + } } return $result; } |