aboutsummaryrefslogtreecommitdiff
path: root/server/src/interaction.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-18 09:57:39 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-23 19:20:50 +0200
commit9bdb81bb34bd6a7e33c47d6fcb3dced1c5bda991 (patch)
treef99e521bf3b199162ed3e4e45536e944fe634489 /server/src/interaction.rs
parenta99aa006599827ea999a5684e40635175c8d790a (diff)
downloadhurrycurry-9bdb81bb34bd6a7e33c47d6fcb3dced1c5bda991.tar
hurrycurry-9bdb81bb34bd6a7e33c47d6fcb3dced1c5bda991.tar.bz2
hurrycurry-9bdb81bb34bd6a7e33c47d6fcb3dced1c5bda991.tar.zst
can start passive recipes
Diffstat (limited to 'server/src/interaction.rs')
-rw-r--r--server/src/interaction.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/server/src/interaction.rs b/server/src/interaction.rs
index 7ef4a9b4..fadfe8d9 100644
--- a/server/src/interaction.rs
+++ b/server/src/interaction.rs
@@ -38,6 +38,11 @@ pub fn interact(
return;
}
+ if !items.is_empty() && hand.is_none() {
+ out(Take(items.len() - 1));
+ return;
+ }
+
if let Some(hi) = hand {
if allowed.contains(&hi) {
out(Put);
@@ -66,6 +71,7 @@ pub fn interact(
match r.action {
Action::Passive(_) => {
+ info!("use recipe {r:?}");
*active = Some(ActiveRecipe {
recipe: ri,
progress: 0.,
@@ -85,14 +91,11 @@ pub fn interact(
if !r.outputs.is_empty() {
out(Take(r.outputs.len() - 1));
}
+ items.clear();
break 'rloop;
}
Action::Never => (),
}
}
}
-
- if !items.is_empty() && hand.is_none() {
- out(Take(items.len() - 1));
- }
}