mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 17:34:58 +03:00
only allow interactive spawning at the beginning
This commit is contained in:
parent
d897ebfd4b
commit
3968a78166
@ -99,7 +99,9 @@ impl SimController {
|
||||
}
|
||||
} else {
|
||||
// Interactively spawning stuff would ruin an A/B test, don't allow it
|
||||
if input.unimportant_key_pressed(Key::S, SIM, "Seed the map with agents") {
|
||||
if primary.sim.is_empty()
|
||||
&& input.unimportant_key_pressed(Key::S, SIM, "Seed the map with agents")
|
||||
{
|
||||
primary.sim.small_spawn(&primary.map);
|
||||
primary.recalculate_current_selection = true;
|
||||
}
|
||||
|
@ -265,6 +265,10 @@ impl Sim {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.time == Tick::zero() && self.is_done()
|
||||
}
|
||||
|
||||
pub fn is_done(&self) -> bool {
|
||||
self.driving_state.is_done() && self.walking_state.is_done() && self.spawner.is_done()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user