replace powi with powf (/b/2785319+DT on linux)

This commit is contained in:
MaxOhn
2024-02-26 13:41:46 +01:00
parent 662e3d7689
commit 798cdcfa0a
8 changed files with 30 additions and 27 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ impl Movement {
dist_addition += DIRECTION_CHANGE_BONUS / (self.last_strain_time + 16.0).sqrt()
* bonus_factor
* anti_flow_factor
* (1.0 - (weighted_strain_time / 1000.0).powi(3)).max(0.0);
* (1.0 - (weighted_strain_time / 1000.0).powf(3.0)).max(0.0);
}
dist_addition += 12.5
+2 -2
View File
@@ -472,7 +472,7 @@ impl CatchPerformanceInner {
let max_combo = attributes.max_combo();
// Relying heavily on aim
let mut pp = (5.0 * (stars / 0.0049).max(1.0) - 4.0).powi(2) / 100_000.0;
let mut pp = (5.0 * (stars / 0.0049).max(1.0) - 4.0).powf(2.0) / 100_000.0;
let mut combo_hits = self.combo_hits();
@@ -490,7 +490,7 @@ impl CatchPerformanceInner {
pp *= len_bonus;
// Penalize misses exponentially
pp *= 0.97_f64.powi(self.state.n_misses as i32);
pp *= 0.97_f64.powf(f64::from(self.state.n_misses));
// Combo scaling
if self.state.max_combo > 0 {