diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2026-08-18 22:42:41 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2026-08-18 22:42:41 -0700 |
| commit | a0b3de6086d5245eaefa9e510cbf2844b0224405 (patch) | |
| tree | ff7937b3b0563e4107e4e7a684eecb14e949e5f3 /src/sim/cell_sim/sim.rs | |
| parent | 2640f91e36558650bb988dcc82b5148ee71f3eb0 (diff) | |
fix parity for sand
Diffstat (limited to 'src/sim/cell_sim/sim.rs')
| -rw-r--r-- | src/sim/cell_sim/sim.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sim/cell_sim/sim.rs b/src/sim/cell_sim/sim.rs index 4b9f05f..253da8a 100644 --- a/src/sim/cell_sim/sim.rs +++ b/src/sim/cell_sim/sim.rs @@ -114,7 +114,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.swapped = true; @@ -145,8 +147,6 @@ pub fn sim_tick_chunk(chunks: &mut [Option<&mut Chunk>; 9], seqno: u64) { if let Some(update) = material.sim_update && cell.parity() == seqno_parity { - cell.flip_parity(); - let mut update_ctx = UpdateCtx { chunks, seqno, |
