From eeffcd83276a6ca3d12f7271b077f6b42a939b06 Mon Sep 17 00:00:00 2001 From: nanaya Date: Wed, 3 Apr 2024 13:48:38 +0900 Subject: [PATCH] Mark score not ranked if not passed --- app/Models/Solo/Score.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Models/Solo/Score.php b/app/Models/Solo/Score.php index be3ab1e527c..54ccba83100 100644 --- a/app/Models/Solo/Score.php +++ b/app/Models/Solo/Score.php @@ -118,11 +118,12 @@ public static function extractParams(array $rawParams, ScoreToken|MultiplayerSco $params['started_at'] = $scoreToken->created_at; $params['user_id'] = $scoreToken->user_id; + $params['passed'] ??= false; + $params['preserve'] = $params['passed']; + $beatmap = $scoreToken->beatmap; // anything that have leaderboard - $params['ranked'] = $beatmap !== null && $beatmap->approved > 0; - - $params['preserve'] = $params['passed'] ?? false; + $params['ranked'] = $params['passed'] && $beatmap !== null && $beatmap->approved > 0; return $params; }