aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/interaction.rs36
1 files changed, 17 insertions, 19 deletions
diff --git a/server/src/interaction.rs b/server/src/interaction.rs
index db4e92a7..a8f80bd8 100644
--- a/server/src/interaction.rs
+++ b/server/src/interaction.rs
@@ -17,7 +17,7 @@
*/
use hurrycurry_client_lib::{Involvement, Item};
use hurrycurry_protocol::{Gamedata, ItemLocation, PacketC, PlayerID, Recipe, Score, TileIndex};
-use log::{info, warn};
+use log::info;
use std::collections::VecDeque;
pub fn interact(
@@ -107,10 +107,8 @@ pub fn interact(
if this.is_none() {
if let Some(item) = &other {
if item.kind == *input {
- let mut item = other.take().unwrap();
- if item.active.is_some() {
- warn!("interact recipe tested when already active")
- } else {
+ if item.active.is_none() {
+ let mut item = other.take().unwrap();
info!("start active recipe {ri:?}");
item.active = Some(Involvement {
player,
@@ -119,21 +117,21 @@ pub fn interact(
position: 0.,
warn: false,
});
+ *this = Some(item);
+ score.active_recipes += 1;
+ packet_out.push_back(PacketC::MoveItem {
+ from: other_loc,
+ to: this_loc,
+ });
+ packet_out.push_back(PacketC::SetProgress {
+ player,
+ item: this_loc,
+ position: 0.,
+ speed: *speed,
+ warn: false,
+ });
+ return;
}
- *this = Some(item);
- score.active_recipes += 1;
- packet_out.push_back(PacketC::MoveItem {
- from: other_loc,
- to: this_loc,
- });
- packet_out.push_back(PacketC::SetProgress {
- player,
- item: this_loc,
- position: 0.,
- speed: *speed,
- warn: false,
- });
- return;
}
}
}