diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-10 18:06:37 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-10 18:06:37 +0200 |
| commit | 3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996 (patch) | |
| tree | c3913fce710a879e2375c60a2b78e0cad483de18 /server/src/entity/environment_effect.rs | |
| parent | f78856e4cd4928c790748b883b7916585980b3dd (diff) | |
| download | hurrycurry-3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996.tar hurrycurry-3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996.tar.bz2 hurrycurry-3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996.tar.zst | |
Update to newest rust; replace rand with std random
Diffstat (limited to 'server/src/entity/environment_effect.rs')
| -rw-r--r-- | server/src/entity/environment_effect.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/src/entity/environment_effect.rs b/server/src/entity/environment_effect.rs index ba2c395e..b5344a27 100644 --- a/server/src/entity/environment_effect.rs +++ b/server/src/entity/environment_effect.rs @@ -1,3 +1,5 @@ +use crate::random_float; + /* Hurry Curry! - a game about cooking Copyright (C) 2025 Hurry Curry! Contributors @@ -18,7 +20,6 @@ use super::{Entity, EntityContext}; use hurrycurry_data::entities::EnvironmentEffect; use hurrycurry_protocol::PacketC; -use rand::random; use std::time::{Duration, Instant}; #[derive(Clone, Debug)] @@ -42,12 +43,12 @@ impl Entity for EnvironmentEffectController { if self.next_transition < Instant::now() { if self.active { self.next_transition += - Duration::from_secs_f32(self.config.on * (0.5 + random::<f32>())); + Duration::from_secs_f32(self.config.on * (0.5 + random_float())); self.active = false; c.game.environment_effects.remove(&self.config.name); } else { self.next_transition += - Duration::from_secs_f32(self.config.off * (0.5 + random::<f32>())); + Duration::from_secs_f32(self.config.off * (0.5 + random_float())); self.active = true; c.game.environment_effects.insert(self.config.name.clone()); } |