osu & fruits: linear sliders with != 2 points are now bezier
This commit is contained in:
+3
-1
@@ -87,7 +87,9 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
|
|||||||
/ 100.0;
|
/ 100.0;
|
||||||
|
|
||||||
// Ensure path type validity
|
// Ensure path type validity
|
||||||
let path_type = if *path_type == PathType::PerfectCurve && curve_points.len() > 3 {
|
let path_type = if (*path_type == PathType::PerfectCurve && curve_points.len() > 3)
|
||||||
|
|| (*path_type == PathType::Linear && curve_points.len() != 2)
|
||||||
|
{
|
||||||
PathType::Bezier
|
PathType::Bezier
|
||||||
} else if curve_points.len() == 2 {
|
} else if curve_points.len() == 2 {
|
||||||
PathType::Linear
|
PathType::Linear
|
||||||
|
|||||||
@@ -447,9 +447,10 @@ mod tests {
|
|||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
// #[ignore]
|
#[ignore]
|
||||||
fn all_included_single() {
|
fn all_included_single() {
|
||||||
let file = match File::open("./maps/100.osu") {
|
// TOCHECK: 114708, 1208872
|
||||||
|
let file = match File::open("./maps/1295309.osu") {
|
||||||
Ok(file) => file,
|
Ok(file) => file,
|
||||||
Err(why) => panic!("Could not open file: {}", why),
|
Err(why) => panic!("Could not open file: {}", why),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ impl OsuObject {
|
|||||||
let span_duration = duration / *repeats as f32;
|
let span_duration = duration / *repeats as f32;
|
||||||
|
|
||||||
// Ensure path type validity
|
// Ensure path type validity
|
||||||
let path_type = if *path_type == PathType::PerfectCurve && curve_points.len() > 3 {
|
let path_type = if (*path_type == PathType::PerfectCurve && curve_points.len() > 3)
|
||||||
|
|| (*path_type == PathType::Linear && curve_points.len() != 2)
|
||||||
|
{
|
||||||
PathType::Bezier
|
PathType::Bezier
|
||||||
} else if curve_points.len() == 2 {
|
} else if curve_points.len() == 2 {
|
||||||
PathType::Linear
|
PathType::Linear
|
||||||
|
|||||||
@@ -63,7 +63,9 @@ impl OsuObject {
|
|||||||
let span_duration = duration / *repeats as f32;
|
let span_duration = duration / *repeats as f32;
|
||||||
|
|
||||||
// Ensure path type validity
|
// Ensure path type validity
|
||||||
let path_type = if *path_type == PathType::PerfectCurve && curve_points.len() > 3 {
|
let path_type = if (*path_type == PathType::PerfectCurve && curve_points.len() > 3)
|
||||||
|
|| (*path_type == PathType::Linear && curve_points.len() != 2)
|
||||||
|
{
|
||||||
PathType::Bezier
|
PathType::Bezier
|
||||||
} else if curve_points.len() == 2 {
|
} else if curve_points.len() == 2 {
|
||||||
PathType::Linear
|
PathType::Linear
|
||||||
|
|||||||
Reference in New Issue
Block a user