aboutsummaryrefslogtreecommitdiff
path: root/server/bot/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/bot/src')
-rw-r--r--server/bot/src/algos/customer.rs34
1 files changed, 18 insertions, 16 deletions
diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs
index 592d0574..ec8f2283 100644
--- a/server/bot/src/algos/customer.rs
+++ b/server/bot/src/algos/customer.rs
@@ -65,22 +65,24 @@ impl BotAlgo for Customer {
let pos = playerdata.movement.position;
match self {
Customer::New => {
- if let Some(&chair) = game
- .tiles
- .iter()
- .filter(|(_, t)| game.data.tile_name(t.kind) == "chair")
- .map(|(p, _)| *p)
- .collect::<Vec<_>>()
- .choose(&mut thread_rng())
- {
- if let Some(path) = find_path(&game.walkable, pos.as_ivec2(), chair) {
- info!("{me:?} -> entering");
- *self = Customer::Entering {
- path,
- chair,
- origin: pos.as_ivec2(),
- ticks: 0,
- };
+ if !game.data.demands.is_empty() {
+ if let Some(&chair) = game
+ .tiles
+ .iter()
+ .filter(|(_, t)| game.data.tile_name(t.kind) == "chair")
+ .map(|(p, _)| *p)
+ .collect::<Vec<_>>()
+ .choose(&mut thread_rng())
+ {
+ if let Some(path) = find_path(&game.walkable, pos.as_ivec2(), chair) {
+ info!("{me:?} -> entering");
+ *self = Customer::Entering {
+ path,
+ chair,
+ origin: pos.as_ivec2(),
+ ticks: 0,
+ };
+ }
}
}
BotInput::default()