aboutsummaryrefslogtreecommitdiff
path: root/server/bot
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-10-06 17:19:43 +0200
committermetamuffin <metamuffin@disroot.org>2024-10-06 17:19:43 +0200
commit7f95091f799d5a95854008b1475b341ec60b0352 (patch)
tree9251617a8bcc078ccfe8201ed3e3faeefbf98249 /server/bot
parent25976e888def15d3ae63635385372f9c8313e0b9 (diff)
downloadhurrycurry-7f95091f799d5a95854008b1475b341ec60b0352.tar
hurrycurry-7f95091f799d5a95854008b1475b341ec60b0352.tar.bz2
hurrycurry-7f95091f799d5a95854008b1475b341ec60b0352.tar.zst
fix dishwasher crash, fixes #216
Diffstat (limited to 'server/bot')
-rw-r--r--server/bot/src/algos/dishwasher.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/bot/src/algos/dishwasher.rs b/server/bot/src/algos/dishwasher.rs
index bfe57d0c..b52b72d1 100644
--- a/server/bot/src/algos/dishwasher.rs
+++ b/server/bot/src/algos/dishwasher.rs
@@ -99,10 +99,9 @@ impl Context<'_, DishWasher> {
self.assert_tile_is_clear(pos)?;
}
if self.is_hand_item(self.state.dirty_plate.unwrap()) {
- self.interact_with(
- self.find_empty_interactable_tile_by_name("sink").unwrap(),
- 2.0,
- )?;
+ if let Some(sink) = self.find_empty_interactable_tile_by_name("sink") {
+ self.interact_with(sink, 2.0)?;
+ }
}
self.assert_hand_is_clear()?;
Ok(())