fruits: fix handling passed_objects
This commit is contained in:
+3
-3
@@ -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.
|
/// 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
|
// Slider parsing based on https://github.com/osufx/catch-the-pp
|
||||||
pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> StarResult {
|
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 map.hit_objects.len() < 2 {
|
||||||
|
|
||||||
if take < 2 {
|
|
||||||
return StarResult::Fruits(DifficultyAttributes::default());
|
return StarResult::Fruits(DifficultyAttributes::default());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let take = passed_objects.unwrap_or_else(|| usize::MAX);
|
||||||
|
|
||||||
let attributes = map.attributes().mods(mods);
|
let attributes = map.attributes().mods(mods);
|
||||||
let with_hr = mods.hr();
|
let with_hr = mods.hr();
|
||||||
let mut ticks = Vec::new(); // using the same buffer for all sliders
|
let mut ticks = Vec::new(); // using the same buffer for all sliders
|
||||||
|
|||||||
Reference in New Issue
Block a user