fix: handle acc pp calc for niche case
The score 3051169674 causes intermediate negative values but still a positive value overall so we need to cast to i32.
This commit is contained in:
+13
-10
@@ -942,20 +942,23 @@ impl OsuPerformanceInner<'_> {
|
|||||||
amount_hit_objects_with_acc += self.attrs.n_sliders;
|
amount_hit_objects_with_acc += self.attrs.n_sliders;
|
||||||
}
|
}
|
||||||
|
|
||||||
let better_acc_percentage = if amount_hit_objects_with_acc > 0 {
|
let mut better_acc_percentage = if amount_hit_objects_with_acc > 0 {
|
||||||
let sub = self.state.total_hits() - amount_hit_objects_with_acc;
|
f64::from(
|
||||||
|
(self.state.n300 as i32
|
||||||
// * It is possible to reach a negative accuracy with this formula. Cap it at zero - zero points.
|
- (self.state.total_hits() as i32 - amount_hit_objects_with_acc as i32))
|
||||||
if self.state.n300 < sub {
|
* 6
|
||||||
0.0
|
+ self.state.n100 as i32 * 2
|
||||||
} else {
|
+ self.state.n50 as i32,
|
||||||
f64::from((self.state.n300 - sub) * 6 + self.state.n100 * 2 + self.state.n50)
|
) / f64::from(amount_hit_objects_with_acc * 6)
|
||||||
/ f64::from(amount_hit_objects_with_acc * 6)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
0.0
|
0.0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// * It is possible to reach a negative accuracy with this formula. Cap it at zero - zero points.
|
||||||
|
if better_acc_percentage < 0.0 {
|
||||||
|
better_acc_percentage = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
// * Lots of arbitrary values from testing.
|
// * Lots of arbitrary values from testing.
|
||||||
// * Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution.
|
// * Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution.
|
||||||
let mut acc_value =
|
let mut acc_value =
|
||||||
|
|||||||
Reference in New Issue
Block a user