fix bug with reset sim

This commit is contained in:
Dustin Carlino 2019-05-09 11:02:24 -07:00
parent 8e949d5fa9
commit 994eb2dd73

View File

@ -214,13 +214,16 @@ impl SandboxMode {
if mode.menu.action("speed up sim") {
mode.desired_speed += ADJUST_SPEED;
}
if !state.ui.primary.sim.is_empty() && mode.menu.action("reset sim") {
state.ui.primary.reset_sim();
mode.state = State::Paused;
}
match mode.state {
State::Paused => {
if !state.ui.primary.sim.is_empty() && mode.menu.action("reset sim") {
state.ui.primary.reset_sim();
mode.state = State::Paused;
mode.following = None;
mode.route_viewer = route_viewer::RouteViewer::Inactive;
mode.show_activity = show_activity::ShowActivity::Inactive;
}
if mode.menu.action("save sim state") {
state.ui.primary.sim.save();
}