diff options
Diffstat (limited to 'server/bot/src')
-rw-r--r-- | server/bot/src/algos/customer.rs | 4 | ||||
-rw-r--r-- | server/bot/src/algos/frank.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs index b0ece9dd..9e7ae094 100644 --- a/server/bot/src/algos/customer.rs +++ b/server/bot/src/algos/customer.rs @@ -25,7 +25,7 @@ use hurrycurry_protocol::{ DemandIndex, Hand, Message, PacketS, PlayerClass, PlayerID, Score, }; use log::info; -use rand::{random, seq::IndexedRandom, thread_rng}; +use rand::{random, rng, seq::IndexedRandom}; #[derive(Debug, Clone, Default)] pub struct Customer { @@ -109,7 +109,7 @@ impl CustomerState { .filter(|(_, t)| game.data.tile_name(t.kind) == "chair") .map(|(p, _)| *p) .collect::<Vec<_>>() - .choose(&mut thread_rng()) + .choose(&mut rng()) { if let Some(path) = find_path(&game.walkable, pos.as_ivec2(), chair) { info!("{me:?} -> entering"); diff --git a/server/bot/src/algos/frank.rs b/server/bot/src/algos/frank.rs index 47b8ca7d..38ee927c 100644 --- a/server/bot/src/algos/frank.rs +++ b/server/bot/src/algos/frank.rs @@ -21,7 +21,7 @@ use crate::{ }; use hurrycurry_client_lib::Game; use hurrycurry_protocol::{glam::Vec2, Message, PacketS, PlayerClass, PlayerID}; -use rand::{random, seq::IndexedRandom, thread_rng}; +use rand::{random, rng, seq::IndexedRandom}; #[derive(Default)] pub struct Frank { @@ -110,5 +110,5 @@ fn find_chef(game: &Game, me: PlayerID) -> Option<PlayerID> { .filter(|(i, p)| p.class == PlayerClass::Chef && **i != me) .map(|(i, _)| *i) .collect::<Vec<_>>(); - chefs.choose(&mut thread_rng()).copied() + chefs.choose(&mut rng()).copied() } |