From 99689a21f926816130f7d4dd361a5387eaf79efc Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Sun, 27 Mar 2022 14:13:43 +0200 Subject: [PATCH] Use "object count" as the "more" valid denominator for passed percentage. --- youmubot-osu/src/discord/oppai_cache.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/youmubot-osu/src/discord/oppai_cache.rs b/youmubot-osu/src/discord/oppai_cache.rs index 693f5ce..a71fa45 100644 --- a/youmubot-osu/src/discord/oppai_cache.rs +++ b/youmubot-osu/src/discord/oppai_cache.rs @@ -15,6 +15,7 @@ pub struct BeatmapContent { #[derive(Clone, Copy, Debug)] pub struct BeatmapInfo { pub objects: usize, + pub max_combo: usize, pub stars: f64, } @@ -74,7 +75,8 @@ impl BeatmapContent { pub fn get_info_with(&self, mods: Mods) -> Result { let stars = self.content.stars(mods.bits() as u32, None); Ok(BeatmapInfo { - objects: stars.max_combo().unwrap_or(0), + max_combo: stars.max_combo().unwrap_or(0), + objects: self.content.hit_objects.len(), stars: stars.stars(), }) } @@ -100,9 +102,16 @@ impl BeatmapContent { .calculate() .pp(), ]; - let objects = pp95.difficulty_attributes().max_combo().unwrap_or(0); + let max_combo = pp95.difficulty_attributes().max_combo().unwrap_or(0); let stars = pp95.difficulty_attributes().stars(); - Ok((BeatmapInfo { objects, stars }, pp)) + Ok(( + BeatmapInfo { + objects: self.content.hit_objects.len(), + max_combo, + stars, + }, + pp, + )) } }