diff options
author | nokoe <nokoe@mailbox.org> | 2024-07-23 13:13:01 +0200 |
---|---|---|
committer | nokoe <nokoe@mailbox.org> | 2024-07-23 13:13:01 +0200 |
commit | 1675781c5ee3cbd6e9dc9960a59fda58d9cb75c8 (patch) | |
tree | 622a54ff77d6ef71c3e8290015ae7c5862f8036f /server | |
parent | 989117d062a001dd40a8788b34629266b3741be7 (diff) | |
download | hurrycurry-1675781c5ee3cbd6e9dc9960a59fda58d9cb75c8.tar hurrycurry-1675781c5ee3cbd6e9dc9960a59fda58d9cb75c8.tar.bz2 hurrycurry-1675781c5ee3cbd6e9dc9960a59fda58d9cb75c8.tar.zst |
fix score not being sent when interacting
Diffstat (limited to 'server')
-rw-r--r-- | server/src/entity/conveyor.rs | 1 | ||||
-rw-r--r-- | server/src/entity/portal.rs | 1 | ||||
-rw-r--r-- | server/src/game.rs | 4 |
3 files changed, 6 insertions, 0 deletions
diff --git a/server/src/entity/conveyor.rs b/server/src/entity/conveyor.rs index 7f3d8688..b370356c 100644 --- a/server/src/entity/conveyor.rs +++ b/server/src/entity/conveyor.rs @@ -77,6 +77,7 @@ impl EntityT for Conveyor { Some(to.kind), packet_out, &mut game.score, + &mut game.score_changed, true, ); } diff --git a/server/src/entity/portal.rs b/server/src/entity/portal.rs index dc376681..3ed19719 100644 --- a/server/src/entity/portal.rs +++ b/server/src/entity/portal.rs @@ -50,6 +50,7 @@ impl EntityT for Portal { Some(to.kind), packet_out, &mut game.score, + &mut game.score_changed, true, ); } diff --git a/server/src/game.rs b/server/src/game.rs index 89ea7dfc..e3d170a1 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -415,6 +415,7 @@ impl Game { None, packet_out, &mut self.score, + &mut self.score_changed, false, ) } else { @@ -433,6 +434,7 @@ impl Game { Some(tile.kind), packet_out, &mut self.score, + &mut self.score_changed, false, ) } @@ -628,6 +630,7 @@ pub fn interact_effect( this_tile_kind: Option<TileIndex>, packet_out: &mut VecDeque<PacketC>, score: &mut Score, + score_changed: &mut bool, automated: bool, ) { let this_had_item = this.is_some(); @@ -651,6 +654,7 @@ pub fn interact_effect( } InteractEffect::Produce => { info!("produce {this_loc} <~ {other_loc}"); + *score_changed = true; if this_had_item { packet_out.push_back(PacketC::SetProgress { item: this_loc, |