diff options
Diffstat (limited to 'server/bot/src/algos')
-rw-r--r-- | server/bot/src/algos/customer.rs | 6 | ||||
-rw-r--r-- | server/bot/src/algos/simple.rs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs index e26acf09..b243bd55 100644 --- a/server/bot/src/algos/customer.rs +++ b/server/bot/src/algos/customer.rs @@ -141,7 +141,7 @@ impl CustomerState { if game .tiles .get(&(off + *chair)) - .map_or(false, |t| game.data.is_tile_interactable(t.kind)) + .is_some_and(|t| game.data.is_tile_interactable(t.kind)) { facing = off.as_vec2(); } @@ -240,7 +240,7 @@ impl CustomerState { if game .players .get(&pid) - .map_or(false, |p| p.class.is_cheflike()) + .is_some_and(|p| p.class.is_cheflike()) { pin = true } @@ -369,7 +369,7 @@ impl CustomerState { cooldown, } => { *cooldown -= dt; - if game.players.get(&me).map_or(false, |pl| pl.item.is_none()) { + if game.players.get(&me).is_some_and(|pl| pl.item.is_none()) { if let Some(path) = find_path(&game.walkable, pos.as_ivec2(), *origin) { *self = CustomerState::Exiting { path }; } diff --git a/server/bot/src/algos/simple.rs b/server/bot/src/algos/simple.rs index b275b522..14eb38c4 100644 --- a/server/bot/src/algos/simple.rs +++ b/server/bot/src/algos/simple.rs @@ -109,7 +109,7 @@ impl<S> Context<'_, S> { self.game .players .get(&self.me) - .map_or(false, |p| p.item.as_ref().map_or(false, |i| i.kind == item)) + .is_some_and(|p| p.item.as_ref().is_some_and(|i| i.kind == item)) } pub fn is_hand_occupied(&self) -> bool { self.game @@ -131,7 +131,7 @@ impl<S> Context<'_, S> { self.game .tiles .get(&(pos + *off)) - .map_or(false, |t| self.game.data.tile_interact[t.kind.0]) + .is_some_and(|t| self.game.data.tile_interact[t.kind.0]) }) .map(|off| pos + off) .map(|pos| (*item, pos)) @@ -155,7 +155,7 @@ impl<S> Context<'_, S> { self.game .tiles .get(&(pos + *off)) - .map_or(false, |t| self.game.data.tile_interact[t.kind.0]) + .is_some_and(|t| self.game.data.tile_interact[t.kind.0]) }) .map(|off| pos + off) .map(|pos| (*item, pos)) @@ -177,7 +177,7 @@ impl<S> Context<'_, S> { self.game .tiles .iter() - .find(|(_, t)| t.item.as_ref().map_or(false, |t| t.kind == item)) + .find(|(_, t)| t.item.as_ref().is_some_and(|t| t.kind == item)) .map(|(p, _)| *p) } pub fn find_tile(&self, tile: TileIndex) -> Option<IVec2> { |