dep: use f64 for clock rate
This commit is contained in:
@@ -417,9 +417,9 @@ impl ModsDependentKind {
|
||||
}
|
||||
}
|
||||
|
||||
fn value(&self, mods: &GameMods, mods_fn: impl Fn(&GameMods) -> Option<f32>) -> f32 {
|
||||
fn value(&self, mods: &GameMods, mods_fn: impl Fn(&GameMods) -> Option<f64>) -> f32 {
|
||||
match self {
|
||||
ModsDependentKind::Default(inner) => mods_fn(mods).unwrap_or(inner.value),
|
||||
ModsDependentKind::Default(inner) => mods_fn(mods).map_or(inner.value, |n| n as f32),
|
||||
ModsDependentKind::Custom(inner) => inner.value,
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ impl GameMods {
|
||||
///
|
||||
/// In case of variable clock rates like for `WindUp`, this will return
|
||||
/// `1.0`.
|
||||
pub(crate) fn clock_rate(&self) -> f32 {
|
||||
pub(crate) fn clock_rate(&self) -> f64 {
|
||||
match self.inner {
|
||||
GameModsInner::Lazer(ref mods) => mods.clock_rate().unwrap_or(1.0),
|
||||
GameModsInner::Intermode(ref mods) => mods.legacy_clock_rate(),
|
||||
@@ -105,7 +105,7 @@ macro_rules! impl_map_attr {
|
||||
#[doc = "Check whether the mods specify a custom "]
|
||||
#[doc = $s]
|
||||
#[doc = "value."]
|
||||
pub(crate) fn $fn(&self) -> Option<f32> {
|
||||
pub(crate) fn $fn(&self) -> Option<f64> {
|
||||
match self.inner {
|
||||
GameModsInner::Lazer(ref mods) => mods.iter().find_map(|gamemod| match gamemod {
|
||||
$( impl_map_attr!( @ $mode $field) => *$field, )*
|
||||
|
||||
Reference in New Issue
Block a user