diff --git a/dist/app/Models/Game/Matchmaking/MatchConfiguration.php b/dist/app/Models/Game/Matchmaking/MatchConfiguration.php index 241c611..e275f71 100644 --- a/dist/app/Models/Game/Matchmaking/MatchConfiguration.php +++ b/dist/app/Models/Game/Matchmaking/MatchConfiguration.php @@ -38,10 +38,28 @@ class MatchConfiguration extends Model */ public static function getAvailableMatchConfigs(int $runnerCount, int $hunterCount): Collection { - return MatchConfiguration::where('runners', '<=', $runnerCount) - ->where('hunters', '<=', $hunterCount) - ->where('enabled', '=', true) - ->get(); + $availableMatchConfigs = null + + if($hunterCount == 1 and $runnerCount >= 6) { + $availableMatchConfigs = MatchConfiguration::where('runners', '>=', 6) + ->where('hunters', '=', $hunterCount) + ->where('enabled', '=', true) + ->get(); + } elseif ($hunterCount == 1 and $runnerCount >= 4) { + $availableMatchConfigs = MatchConfiguration::where('runners', '=', $runnerCount) + ->where('hunters', '=', $hunterCount) + ->where('enabled', '=', true) + ->get(); + } + + if ($availableMatchConfigs === null or $availableMatchConfigs->isEmpty()) + return MatchConfiguration::where('runners', '<=', $runnerCount) + ->where('hunters', '<=', $hunterCount) + ->where('enabled', '=', true) + ->get(); + } else { + return $availableMatchConfigs + } } public static function selectRandomConfigByWeight(Collection &$collection): MatchConfiguration|null