From: Daniel Karbach Date: Thu, 29 Feb 2024 22:47:32 +0000 (+0100) Subject: fix scoring X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=dc4019f7a7aa5ba98964e52e481d9d22ed080f3c;p=alttp.git fix scoring --- diff --git a/app/Models/Channel.php b/app/Models/Channel.php index d7d307e..da9f6a7 100644 --- a/app/Models/Channel.php +++ b/app/Models/Channel.php @@ -81,6 +81,9 @@ class Channel extends Model { $distance = abs(intval($guess->guess) - intval($solution)); if (is_null($min_distance) || $distance == $min_distance) { $candidates[] = $guess; + if (is_null($min_distance)) { + $min_distance = $distance; + } } else if ($distance < $min_distance) { $candidates = [$guess]; $min_distance = $distance;