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/bot/src/lib.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/bot/src/lib.rs')
| -rw-r--r-- | server/bot/src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/bot/src/lib.rs b/server/bot/src/lib.rs index cc1cb2a8..927ac7b0 100644 --- a/server/bot/src/lib.rs +++ b/server/bot/src/lib.rs @@ -15,14 +15,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +#![feature(random)] pub mod algos; pub mod pathfinding; use hurrycurry_client_lib::Game; use hurrycurry_protocol::{ - glam::{IVec2, Vec2}, PacketS, PlayerID, + glam::{IVec2, Vec2}, }; +use std::random::random; #[derive(Default, Clone)] pub struct BotInput { @@ -43,3 +45,7 @@ impl<T: BotAlgo + ?Sized> BotAlgo for Box<T> { (**self).tick(me, game, dt) } } + +fn random_float() -> f32 { + random::<u32>(..) as f32 / u32::MAX as f32 +} |