handle pixel_len 0 for catch

This commit is contained in:
Max
2022-11-08 19:59:38 +01:00
parent 7ded74b54e
commit 20d7598e07
3 changed files with 14 additions and 9 deletions
+2 -1
View File
@@ -5,8 +5,9 @@
- __Fixes:__
- Fixed passed object count for taiko by ignoring non-circles
- Fixed a niche panic on UTF-16 encoded maps. ([#18])
- Fixed a niche panic on UTF-16 encoded maps ([#18])
- Fixed an occasional underflow when calculating accuracy pp
- Fixed an infinite loop on special ctb maps
# v0.9.1 (2022-10-26)
+11 -8
View File
@@ -89,7 +89,6 @@ impl FruitOrJuice {
let mut curr_dist = tick_dist;
let pixel_len = pixel_len.unwrap_or(0.0);
let time_add = total_duration * tick_dist / (pixel_len * span_count);
let target = pixel_len - tick_dist / 8.0;
@@ -107,13 +106,17 @@ impl FruitOrJuice {
curr_dist += tick_dist;
}
params.attributes.n_tiny_droplets += tiny_droplet_count(
h.start_time,
time_add,
total_duration,
span_count as usize,
&params.ticks,
);
if pixel_len > 0.0 {
let time_add = total_duration * tick_dist / (pixel_len * span_count);
params.attributes.n_tiny_droplets += tiny_droplet_count(
h.start_time,
time_add,
total_duration,
span_count as usize,
&params.ticks,
);
}
slider_objects.reserve(span_count as usize * (params.ticks.len()));
+1
View File
@@ -599,6 +599,7 @@ impl OsuPpInner {
let better_acc_percentage = if amount_hit_objects_with_acc > 0 {
let sub = self.state.total_hits() - amount_hit_objects_with_acc;
// * It is possible to reach a negative accuracy with this formula. Cap it at zero - zero points.
if self.state.n300 < sub {
0.0
} else {