aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/bot.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-10-10 18:06:37 +0200
committermetamuffin <metamuffin@disroot.org>2025-10-10 18:06:37 +0200
commit3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996 (patch)
treec3913fce710a879e2375c60a2b78e0cad483de18 /server/src/entity/bot.rs
parentf78856e4cd4928c790748b883b7916585980b3dd (diff)
downloadhurrycurry-3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996.tar
hurrycurry-3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996.tar.bz2
hurrycurry-3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996.tar.zst
Update to newest rust; replace rand with std random
Diffstat (limited to 'server/src/entity/bot.rs')
-rw-r--r--server/src/entity/bot.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/src/entity/bot.rs b/server/src/entity/bot.rs
index 8757cc97..26ae77a6 100644
--- a/server/src/entity/bot.rs
+++ b/server/src/entity/bot.rs
@@ -20,8 +20,7 @@ use anyhow::Result;
use hurrycurry_bot::{BotAlgo, DynBotAlgo};
use hurrycurry_protocol::{Character, Hand, PacketS, PlayerClass, PlayerID};
use log::info;
-use rand::random;
-use std::any::Any;
+use std::{any::Any, random::random};
pub type DynBotDriver = BotDriver<DynBotAlgo>;
@@ -50,7 +49,7 @@ impl<T: BotAlgo + Any> Entity for BotDriver<T> {
}
fn tick(&mut self, c: EntityContext<'_>) -> Result<()> {
if let Some((name, character, class)) = self.join_data.take() {
- self.id = PlayerID(random()); // TODO bad code, can collide
+ self.id = PlayerID(random(..)); // TODO bad code, can collide
info!("spawn {:?} ({name:?})", self.id);
c.packet_in.push_back(PacketS::Join {
name,