diff options
Diffstat (limited to 'server/bot/src')
-rw-r--r-- | server/bot/src/algos/customer.rs | 14 | ||||
-rw-r--r-- | server/bot/src/algos/dishwasher.rs | 4 |
2 files changed, 7 insertions, 11 deletions
diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs index 67605ad5..e26acf09 100644 --- a/server/bot/src/algos/customer.rs +++ b/server/bot/src/algos/customer.rs @@ -173,15 +173,11 @@ impl CustomerState { } } else if check && path.remaining_segments() < 5 - && game - .players - .iter() - .find(|(id, p)| { - p.class == PlayerClass::Customer - && **id != me - && p.movement.position.distance(chair.as_vec2() + 0.5) < 1. - }) - .is_some() + && game.players.iter().any(|(id, p)| { + p.class == PlayerClass::Customer + && *id != me + && p.movement.position.distance(chair.as_vec2() + 0.5) < 1. + }) { *self = CustomerState::New; BotInput::default() diff --git a/server/bot/src/algos/dishwasher.rs b/server/bot/src/algos/dishwasher.rs index b52b72d1..e4a49978 100644 --- a/server/bot/src/algos/dishwasher.rs +++ b/server/bot/src/algos/dishwasher.rs @@ -32,9 +32,9 @@ type LogicRes<Out = ()> = Result<Out, ()>; impl BotAlgo for DishWasher { fn tick(&mut self, me: PlayerID, game: &Game, dt: f32) -> BotInput { - if let None = self.dirty_plate { + if self.dirty_plate.is_none() { self.dirty_plate = game.data.get_item_by_name("dirty-plate"); - if let None = self.dirty_plate { + if self.dirty_plate.is_none() { return BotInput::default(); } } |