summaryrefslogtreecommitdiff
path: root/src/sim/cell_sim/sim.rs
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2026-08-21 00:14:10 -0700
committerKai Stevenson <kai@kaistevenson.com>2026-08-21 00:14:10 -0700
commita216e61a00bde792a49a92593012f9baecf86f3d (patch)
treee8df7028c29c569a3a54c688d8d12445e0086260 /src/sim/cell_sim/sim.rs
parent533da47f2cc03a8b60a7c6c0bb5a938a7e523a03 (diff)
explosions
Diffstat (limited to 'src/sim/cell_sim/sim.rs')
-rw-r--r--src/sim/cell_sim/sim.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sim/cell_sim/sim.rs b/src/sim/cell_sim/sim.rs
index 9b07b98..3fc3a0f 100644
--- a/src/sim/cell_sim/sim.rs
+++ b/src/sim/cell_sim/sim.rs
@@ -171,7 +171,7 @@ pub struct UpdateCtx<'a, 'b, 'c> {
pub material: &'c MaterialDef,
pub rng: &'c mut dyn Rng,
- swapped: bool,
+ pub do_rewrite: bool,
}
impl UpdateCtx<'_, '_, '_> {
@@ -202,7 +202,7 @@ impl UpdateCtx<'_, '_, '_> {
self.cell.match_parity(self.seqno + 1);
self.set_cell(0, 0, candidate_cell);
self.set_cell(dx, dy, *self.cell);
- self.swapped = true;
+ self.do_rewrite = false;
return true;
}
}
@@ -245,12 +245,12 @@ pub fn sim_tick_chunk(chunks: &mut [Option<&mut Chunk>; 9], seqno: u64) {
// TODO this is platform-dependent, will break for multiplayer
rng: &mut rng,
- swapped: false,
+ do_rewrite: true,
};
update(&mut update_ctx);
- if !update_ctx.swapped {
+ if update_ctx.do_rewrite {
// the cell didn't move, so it's more settled, and we also need to update its state for parity
cell.increment_settled();
set_cell(chunks, x, y, cell);