clamp clock rate

This commit is contained in:
MaxOhn
2023-02-09 06:25:26 +01:00
parent 1b5399070e
commit 7bac0c7215
9 changed files with 27 additions and 8 deletions
+3 -1
View File
@@ -89,9 +89,11 @@ impl<'map> ManiaStars<'map> {
/// Adjust the clock rate used in the calculation.
/// If none is specified, it will take the clock rate based on the mods
/// i.e. 1.5 for DT, 0.75 for HT and 1.0 otherwise.
///
/// The value cannot go below 0.001.
#[inline]
pub fn clock_rate(mut self, clock_rate: f64) -> Self {
self.clock_rate = Some(clock_rate);
self.clock_rate = Some(clock_rate.max(0.001));
self
}
+3 -1
View File
@@ -120,9 +120,11 @@ impl<'map> ManiaPP<'map> {
/// Adjust the clock rate used in the calculation.
/// If none is specified, it will take the clock rate based on the mods
/// i.e. 1.5 for DT, 0.75 for HT and 1.0 otherwise.
///
/// The value cannot go below 0.001.
#[inline]
pub fn clock_rate(mut self, clock_rate: f64) -> Self {
self.clock_rate = Some(clock_rate);
self.clock_rate = Some(clock_rate.max(0.001));
self
}