diff options
Diffstat (limited to 'src/sim/cell_sim')
| -rw-r--r-- | src/sim/cell_sim/sim.rs | 8 |
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); |
