diff options
| author | nokoe <nokoe@mailbox.org> | 2026-02-27 19:41:22 +0100 |
|---|---|---|
| committer | nokoe <nokoe@mailbox.org> | 2026-02-27 19:41:22 +0100 |
| commit | c1a20426838a5729c2c874eae73dbb974fcf7906 (patch) | |
| tree | 7138b1a4ca5f7f6b561aa05b0aae05071c581084 /server/src/lib.rs | |
| parent | 70e6d510ba236730260371a3259ffb16f999f5d4 (diff) | |
| parent | a859bceeddc8e746bba630b3cc197532b68adbcb (diff) | |
| download | hurrycurry-c1a20426838a5729c2c874eae73dbb974fcf7906.tar hurrycurry-c1a20426838a5729c2c874eae73dbb974fcf7906.tar.bz2 hurrycurry-c1a20426838a5729c2c874eae73dbb974fcf7906.tar.zst | |
Merge branch 'stable-rust'
Diffstat (limited to 'server/src/lib.rs')
| -rw-r--r-- | server/src/lib.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/server/src/lib.rs b/server/src/lib.rs index c166e665..f2fdfbe6 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -15,7 +15,7 @@ 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 benchmark; pub mod commands; pub mod entity; @@ -25,7 +25,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); @@ -50,9 +51,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. } |