Use "object count" as the "more" valid denominator for passed percentage.

This commit is contained in:
Natsu Kagami 2022-03-27 14:13:43 +02:00
parent 8d2344435b
commit 99689a21f9
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51

View file

@ -15,6 +15,7 @@ pub struct BeatmapContent {
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]
pub struct BeatmapInfo { pub struct BeatmapInfo {
pub objects: usize, pub objects: usize,
pub max_combo: usize,
pub stars: f64, pub stars: f64,
} }
@ -74,7 +75,8 @@ impl BeatmapContent {
pub fn get_info_with(&self, mods: Mods) -> Result<BeatmapInfo> { pub fn get_info_with(&self, mods: Mods) -> Result<BeatmapInfo> {
let stars = self.content.stars(mods.bits() as u32, None); let stars = self.content.stars(mods.bits() as u32, None);
Ok(BeatmapInfo { 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(), stars: stars.stars(),
}) })
} }
@ -100,9 +102,16 @@ impl BeatmapContent {
.calculate() .calculate()
.pp(), .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(); let stars = pp95.difficulty_attributes().stars();
Ok((BeatmapInfo { objects, stars }, pp)) Ok((
BeatmapInfo {
objects: self.content.hit_objects.len(),
max_combo,
stars,
},
pp,
))
} }
} }