diff options
| author | nokoe <nokoe@mailbox.org> | 2026-02-26 05:15:54 +0100 |
|---|---|---|
| committer | nokoe <nokoe@mailbox.org> | 2026-02-27 19:31:14 +0100 |
| commit | a859bceeddc8e746bba630b3cc197532b68adbcb (patch) | |
| tree | f8e033595d21e4de34774e4caed8b483c7eba5c6 /server/src/lib.rs | |
| parent | 6419d8c8139d697af309b7db2e698effa8290582 (diff) | |
| download | hurrycurry-stable-rust.tar hurrycurry-stable-rust.tar.bz2 hurrycurry-stable-rust.tar.zst | |
use stable rust toolchainstable-rust
Diffstat (limited to 'server/src/lib.rs')
| -rw-r--r-- | server/src/lib.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/server/src/lib.rs b/server/src/lib.rs index 042fcb6c..79cdbeb3 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -15,7 +15,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -#![feature(if_let_guard, iterator_try_collect, stmt_expr_attributes, random)] pub mod commands; pub mod entity; pub mod network; @@ -24,7 +23,8 @@ pub mod server; pub mod state; use hurrycurry_protocol::glam::Vec2; -use std::{fmt::Display, random::random}; +use rand::random; +use std::fmt::Display; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct ConnectionID(pub i64); @@ -49,9 +49,6 @@ impl InterpolateExt for f32 { } } -fn random_float() -> f32 { - random::<u32>(..) as f32 / u32::MAX as f32 -} fn random_gauss() -> f32 { - [(); 12].map(|()| random_float()).iter().sum::<f32>() - 6. + [(); 12].map(|()| random::<f32>()).iter().sum::<f32>() - 6. } |