diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2026-08-21 23:57:29 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2026-08-22 00:07:01 -0700 |
| commit | b13e8cc52ca3d9e80339fd6acc10159c5ffc2903 (patch) | |
| tree | e239b3cff09aefde1a13352f4d142fa46256092f | |
| parent | defc5f0712734f5decf5b7e174598d256cd6feb3 (diff) | |
fix incorrectly sleeping chunks
| -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); } |
