aboutsummaryrefslogtreecommitdiff
path: root/server/bot/src/algos/customer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/bot/src/algos/customer.rs')
-rw-r--r--server/bot/src/algos/customer.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs
index 06dc373c..5a6f71f7 100644
--- a/server/bot/src/algos/customer.rs
+++ b/server/bot/src/algos/customer.rs
@@ -112,7 +112,7 @@ impl CustomerState {
.map(|(p, _)| *p)
.collect::<Vec<_>>();
if let Some(&chair) = chairs.get(random::<usize>(..) % chairs.len().max(1))
- && let Some(path) = find_path(&game.walkable, pos.as_ivec2(), chair)
+ && let Some(path) = find_path(game, pos.as_ivec2(), chair)
{
debug!("{me:?} -> entering");
*self = CustomerState::Entering {
@@ -185,7 +185,7 @@ impl CustomerState {
*self = CustomerState::New;
BotInput::default()
} else if path.is_stuck() {
- if let Some(path) = find_path(&game.walkable, pos.as_ivec2(), *origin) {
+ if let Some(path) = find_path(game, pos.as_ivec2(), *origin) {
*self = CustomerState::Exiting { path };
}
BotInput::default()
@@ -208,8 +208,7 @@ impl CustomerState {
*timeout -= dt;
*check += 1;
if *timeout <= 0. {
- let path = find_path(&game.walkable, pos.as_ivec2(), *origin)
- .expect("no path to exit");
+ let path = find_path(game, pos.as_ivec2(), *origin).expect("no path to exit");
debug!("{me:?} -> exiting");
*self = CustomerState::Exiting { path };
return BotInput {
@@ -381,7 +380,7 @@ impl CustomerState {
.is_some_and(|pl| pl.items[0].is_none())
// TODO index out of bounds?
{
- if let Some(path) = find_path(&game.walkable, pos.as_ivec2(), *origin) {
+ if let Some(path) = find_path(game, pos.as_ivec2(), *origin) {
*self = CustomerState::Exiting { path };
}
BotInput::default()