diff options
| -rw-r--r-- | src/sim/cell_sim/sim.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sim/cell_sim/sim.rs b/src/sim/cell_sim/sim.rs index 3fc3a0f..92a263e 100644 --- a/src/sim/cell_sim/sim.rs +++ b/src/sim/cell_sim/sim.rs @@ -197,9 +197,9 @@ impl UpdateCtx<'_, '_, '_> { && candidate_cell.material.def().density < self.material.density { candidate_cell.reset_settled(); - candidate_cell.match_parity(self.seqno + 1); self.cell.reset_settled(); self.cell.match_parity(self.seqno + 1); + self.set_cell(0, 0, candidate_cell); self.set_cell(dx, dy, *self.cell); self.do_rewrite = false; @@ -252,6 +252,7 @@ pub fn sim_tick_chunk(chunks: &mut [Option<&mut Chunk>; 9], seqno: u64) { 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.match_parity(seqno + 1); cell.increment_settled(); set_cell(chunks, x, y, cell); } |
