summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 92fe01e..7cbf9d0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -252,10 +252,10 @@ impl ApplicationHandler for App {
&& r > 0.9
{
let mut cell = Cell::from_material(self.config.brush_material);
+ // ensure we simulate on the first tick
cell.flags = (self.sim_seqno as u8) & 0b1;
world.set_cell_from_game_position(
- x, y, cell, // wake the chunk
- false,
+ x, y, cell, false, // wake the chunk
);
}
}
@@ -266,13 +266,13 @@ impl ApplicationHandler for App {
let secs_since_last_tick = (now - self.last_sim_tick).as_secs_f32();
let expected_secs_since_last_tick = 1.0 / SIM_FPS as f32;
+ self.last_sim_tick = now;
if self.sim_paused && self.ignore_pause_next_tick {
sim_tick(world, self.sim_seqno, self.config.use_threading);
self.sim_seqno += 1;
self.ignore_pause_next_tick = false;
} else if !self.sim_paused {
self.sim_ticks_due += secs_since_last_tick / expected_secs_since_last_tick;
- self.last_sim_tick = now;
let mut ticks_done = 0;
// don't ever tick more than 3 times per frame, or else we can get a pseudo deadlock
while self.sim_ticks_due >= 1.0 && ticks_done < 3 {