aboutsummaryrefslogtreecommitdiff
path: root/server/src/customer/mod.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-09 14:52:54 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-09 14:52:54 +0200
commit13cbcc920a2756376e0005046b4b82c68eb9c9da (patch)
treebabcd00e7fedc9a2fd8001d3435d7c1268aeb414 /server/src/customer/mod.rs
parent52f7b5833510b0e55d4942d99f1c8046643ee31d (diff)
downloadhurrycurry-13cbcc920a2756376e0005046b4b82c68eb9c9da.tar
hurrycurry-13cbcc920a2756376e0005046b4b82c68eb9c9da.tar.bz2
hurrycurry-13cbcc920a2756376e0005046b4b82c68eb9c9da.tar.zst
implement auto release on active (and passive) recipes
Diffstat (limited to 'server/src/customer/mod.rs')
-rw-r--r--server/src/customer/mod.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/server/src/customer/mod.rs b/server/src/customer/mod.rs
index 10788206..ba57542c 100644
--- a/server/src/customer/mod.rs
+++ b/server/src/customer/mod.rs
@@ -220,9 +220,8 @@ impl DemandState {
persist: false,
},
));
- for edge in [true, false] {
- packets_out.push((id, PacketS::Interact { pos, edge }))
- }
+ packets_out.push((id, PacketS::Interact { pos: Some(pos) }));
+ packets_out.push((id, PacketS::Interact { pos: None }));
p.state = CustomerState::Eating {
demand: *demand,
target: pos,
@@ -244,9 +243,8 @@ impl DemandState {
if *progress >= 1. {
packets_out.push((id, PacketS::ReplaceHand { item: demand.to }));
if demand.to.is_some() {
- for edge in [true, false] {
- packets_out.push((id, PacketS::Interact { pos: *target, edge }))
- }
+ packets_out.push((id, PacketS::Interact { pos: Some(*target) }));
+ packets_out.push((id, PacketS::Interact { pos: None }));
}
let path = find_path(
&self.walkable,