From a216e61a00bde792a49a92593012f9baecf86f3d Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Fri, 21 Aug 2026 00:14:10 -0700 Subject: explosions --- src/sim/cell_sim/sim.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sim/cell_sim') 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); -- cgit v1.3.1