From 3fe8ba7f1b9fa7e38fa03f55fd898c8ca2a0e996 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 10 Oct 2025 18:06:37 +0200 Subject: Update to newest rust; replace rand with std random --- server/src/entity/customers.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'server/src/entity/customers.rs') diff --git a/server/src/entity/customers.rs b/server/src/entity/customers.rs index 22522e4e..1e795ac5 100644 --- a/server/src/entity/customers.rs +++ b/server/src/entity/customers.rs @@ -1,3 +1,7 @@ +use std::random::random; + +use crate::random_float; + /* Hurry Curry! - a game about cooking Copyright (C) 2025 Hurry Curry! Contributors @@ -15,11 +19,10 @@ along with this program. If not, see . */ -use super::{bot::BotDriver, Entity, EntityContext}; +use super::{Entity, EntityContext, bot::BotDriver}; use anyhow::Result; use hurrycurry_bot::algos::{Customer, CustomerConfig}; use hurrycurry_protocol::{Character, PlayerClass}; -use rand::random; pub struct Customers { customers: Vec>, @@ -53,12 +56,12 @@ impl Entity for Customers { self.spawn_cooldown -= c.dt; self.spawn_cooldown = self.spawn_cooldown.max(0.); if self.customers.len() < max_count && self.spawn_cooldown <= 0. { - self.spawn_cooldown = 5. + random::() * 5.; + self.spawn_cooldown = 5. + random_float() * 5.; let bot = BotDriver::new( "".to_string(), Character { - color: random(), - hairstyle: random(), + color: random(..), + hairstyle: random(..), headwear: 0, }, PlayerClass::Customer, -- cgit v1.3