diff --git a/game/src/sandbox/gameplay/freeform.rs b/game/src/sandbox/gameplay/freeform.rs index 21dadf9838..5019247a30 100644 --- a/game/src/sandbox/gameplay/freeform.rs +++ b/game/src/sandbox/gameplay/freeform.rs @@ -196,12 +196,6 @@ pub fn make_change_traffic( &btn, choices, Box::new(|scenario_name, ctx, app| { - if scenario_name == "census" { - return Transition::Push(crate::sandbox::gameplay::census::CensusGenerator::new( - ctx, - )); - } - Transition::Multi(vec![ Transition::Pop, Transition::Replace(SandboxMode::simple_new( diff --git a/game/src/sandbox/gameplay/mod.rs b/game/src/sandbox/gameplay/mod.rs index a1581de34b..9a84e71a3c 100644 --- a/game/src/sandbox/gameplay/mod.rs +++ b/game/src/sandbox/gameplay/mod.rs @@ -118,6 +118,12 @@ impl GameplayMode { LoadScenario::Scenario(ScenarioGenerator::small_run(map).generate(map, &mut rng, timer)) } else if name == "home_to_work" { LoadScenario::Scenario(ScenarioGenerator::proletariat_robot(map, &mut rng, timer)) + } else if name == "census" { + let config = popdat::Config::default(); + LoadScenario::Scenario( + popdat::generate_scenario("typical monday", config, map, &mut rng) + .expect("unable to build census scenario"), + ) } else { LoadScenario::Path(abstutil::path_scenario(map.get_name(), &name)) }