mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 17:34:58 +03:00
fix bug where commands scheduled at tick 0 were skipped
This commit is contained in:
parent
6dad7155aa
commit
e681032866
@ -138,8 +138,6 @@ impl Sim {
|
||||
}
|
||||
|
||||
fn inner_step(&mut self, map: &Map, control_map: &ControlMap) -> Result<(Vec<Event>), Error> {
|
||||
self.time = self.time.next();
|
||||
|
||||
let mut view = WorldView::new();
|
||||
let mut events: Vec<Event> = Vec::new();
|
||||
|
||||
@ -216,6 +214,10 @@ impl Sim {
|
||||
}
|
||||
}
|
||||
|
||||
// Do this at the end of the step, so that tick 0 actually occurs and things can happen
|
||||
// then.
|
||||
self.time = self.time.next();
|
||||
|
||||
Ok(events)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user