Skip to content

Commit

Permalink
Merge pull request #11141 from nanaya/passed-preserve
Browse files Browse the repository at this point in the history
Mark score not ranked if not passed
  • Loading branch information
peppy authored Apr 3, 2024
2 parents 8268b7d + eeffcd8 commit 9d9ec97
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/Models/Solo/Score.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9d9ec97

Please sign in to comment.