From 921228b7bf3c1ad00d11325c535ac377a4cfddd6 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 28 Jan 2022 09:37:25 +0000 Subject: [PATCH] Add a headless API command to load a map with an empty simulation. #838 --- headless/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/headless/src/main.rs b/headless/src/main.rs index 7ff0361237..7ded8b9757 100644 --- a/headless/src/main.rs +++ b/headless/src/main.rs @@ -161,6 +161,12 @@ fn handle_command( Ok("flags changed and sim reloaded".to_string()) } + "/sim/load-blank" => { + *map = + Map::load_synchronously(get("map")?.to_string(), &mut Timer::new("load new map")); + *sim = Sim::new(&map, SimOptions::default()); + Ok("map changed, blank simulation".to_string()) + } "/sim/get-time" => Ok(sim.time().to_string()), "/sim/goto-time" => { let t = Time::parse(get("t")?)?;