diff options
Diffstat (limited to 'server/src/entity/customers.rs')
| -rw-r--r-- | server/src/entity/customers.rs | 13 |
1 files changed, 8 insertions, 5 deletions
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 <https://www.gnu.org/licenses/>. */ -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<BotDriver<Customer>>, @@ -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::<f32>() * 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, |