From ada25eeb227b201b1519ff46a888476a832256e6 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 12 Aug 2024 12:59:36 +0200 Subject: bot: clear passive tile target --- server/bot/src/algos/simple.rs | 4 +++- server/bot/src/pathfinding.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'server/bot/src') diff --git a/server/bot/src/algos/simple.rs b/server/bot/src/algos/simple.rs index ba5fd5ff..afa5764f 100644 --- a/server/bot/src/algos/simple.rs +++ b/server/bot/src/algos/simple.rs @@ -249,7 +249,7 @@ impl SimpleContext<'_> { if let Some(pos) = self.find_tile(*tile) { self.assert_tile_is_clear(pos)?; self.aquire_item(*input)?; - self.interact_with(pos, duration + 0.5)?; + self.interact_with(pos, duration + 0.2)?; } } Recipe::Passive { @@ -264,6 +264,8 @@ impl SimpleContext<'_> { self.state.cooldown = 0.5; return Err(()); // waiting for it to finish // TODO check progress + } else { + self.assert_tile_is_clear(pos)?; } } self.aquire_item(*input)?; diff --git a/server/bot/src/pathfinding.rs b/server/bot/src/pathfinding.rs index ec557e28..e6457cff 100644 --- a/server/bot/src/pathfinding.rs +++ b/server/bot/src/pathfinding.rs @@ -32,7 +32,7 @@ impl Path { if next.distance(position) < if self.0.len() == 1 { 0.1 } else { 0.6 } { self.0.pop(); } - (next - position).normalize_or_zero() * 0.5 + (next - position).normalize_or_zero() } else { Vec2::ZERO } -- cgit v1.2.3-70-g09d2