diff --git a/src/cmd.rs b/src/cmd.rs index e63eac0..c7fac85 100644 --- a/src/cmd.rs +++ b/src/cmd.rs @@ -748,6 +748,11 @@ fn spawn_scenes( for state_wrapper in er_spawnscene.read() { let root_state = &state_wrapper.0; + let mut found = false; + let scene_name = root_state + .name + .clone() + .unwrap_or_else(|| String::from("ERROR_NO_SCENE_NAME")); let scene_defs = include!("data/scenes.in"); for (name, template, pos, rot) in scene_defs { let pos = DVec3::new( @@ -755,7 +760,8 @@ fn spawn_scenes( root_state.pos[1] + pos[2], root_state.pos[2] - pos[1], ); - if Some(name.to_string()) == root_state.name { + if name == scene_name { + found = true; let mut state = ParserState::default(); state.class = DefClass::Actor; state.pos = pos; @@ -902,6 +908,9 @@ fn spawn_scenes( } } } + if !found { + error!("Undefined scene `{}'", scene_name); + } } }