fruits: fix handling passed_objects

This commit is contained in:
MaxOhn
2021-02-03 11:37:18 +01:00
parent e43b824062
commit 6b5dea5c2a
+3 -3
View File
@@ -29,12 +29,12 @@ const LEGACY_LAST_TICK_OFFSET: f32 = 36.0;
/// In case of a partial play, e.g. a fail, one can specify the amount of passed objects.
// Slider parsing based on https://github.com/osufx/catch-the-pp
pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> StarResult {
let take = passed_objects.unwrap_or_else(|| map.hit_objects.len());
if take < 2 {
if map.hit_objects.len() < 2 {
return StarResult::Fruits(DifficultyAttributes::default());
}
let take = passed_objects.unwrap_or_else(|| usize::MAX);
let attributes = map.attributes().mods(mods);
let with_hr = mods.hr();
let mut ticks = Vec::new(); // using the same buffer for all sliders