From a859bceeddc8e746bba630b3cc197532b68adbcb Mon Sep 17 00:00:00 2001 From: nokoe Date: Thu, 26 Feb 2026 05:15:54 +0100 Subject: use stable rust toolchain --- server/bot/src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'server/bot/src/lib.rs') diff --git a/server/bot/src/lib.rs b/server/bot/src/lib.rs index 078314b1..31f2132a 100644 --- a/server/bot/src/lib.rs +++ b/server/bot/src/lib.rs @@ -15,7 +15,7 @@ along with this program. If not, see . */ -#![feature(random)] + pub mod algos; pub mod pathfinding; pub mod step; @@ -24,7 +24,8 @@ use hurrycurry_game_core::Game; use hurrycurry_protocol::PacketS; #[cfg(feature = "debug_events")] use hurrycurry_protocol::{PlayerID, glam::Vec3}; -use std::{collections::VecDeque, random::random}; +use rand::{Rng, RngExt}; +use std::{collections::VecDeque}; pub struct PacketSink<'a> { buf: &'a mut VecDeque, @@ -54,8 +55,8 @@ impl BotAlgo for Box { } } -fn random_float() -> f32 { - random::(..) as f32 / u32::MAX as f32 +fn random_usize(rng: &mut T) -> usize { + usize::from_ne_bytes(rng.random()) } #[cfg(feature = "debug_events")] -- cgit v1.3