start in scenario mode more intelligently from CLI

This commit is contained in:
Dustin Carlino 2020-04-08 11:25:22 -07:00
parent 9591699463
commit c53f6fdc97

View File

@ -102,6 +102,14 @@ fn main() {
sandbox::TutorialPointer::new(n - 1, 0),
));
}
if mode.is_none() && flags.sim_flags.load.contains("scenarios/") {
// TODO regex
let parts = flags.sim_flags.load.split("/").collect::<Vec<_>>();
let map_path = abstutil::path_map(parts[4]);
let scenario = abstutil::basename(parts[5]);
flags.sim_flags.load = map_path.clone();
mode = Some(sandbox::GameplayMode::PlayScenario(map_path, scenario));
}
args.done();