mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-19 08:48:54 +00:00
Don't assume user_best scores have pp
This commit is contained in:
parent
13683aa229
commit
94dc225b86
1 changed files with 5 additions and 1 deletions
|
@ -612,7 +612,11 @@ pub async fn check(ctx: &Context, msg: &Message, mut args: Args) -> CommandResul
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|s| s.mods.contains(mods))
|
.filter(|s| s.mods.contains(mods))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
scores.sort_by(|a, b| b.pp.unwrap().partial_cmp(&a.pp.unwrap()).unwrap());
|
scores.sort_by(|a, b| {
|
||||||
|
b.pp.unwrap_or(-1.0)
|
||||||
|
.partial_cmp(&a.pp.unwrap_or(-1.0))
|
||||||
|
.unwrap()
|
||||||
|
});
|
||||||
|
|
||||||
if scores.is_empty() {
|
if scores.is_empty() {
|
||||||
msg.reply(&ctx, "No scores found").await?;
|
msg.reply(&ctx, "No scores found").await?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue