From c7437a1dfc34268ceb72900e9ae069a145661ad8 Mon Sep 17 00:00:00 2001 From: Joseph Walton-Rivers <joseph@walton-rivers.uk> Date: Thu, 23 Jun 2022 22:08:21 +0100 Subject: [PATCH] warn if prototype file does not exist --- fggl/ecs3/prototype/loader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fggl/ecs3/prototype/loader.cpp b/fggl/ecs3/prototype/loader.cpp index 3a30d26..5c5ca6f 100644 --- a/fggl/ecs3/prototype/loader.cpp +++ b/fggl/ecs3/prototype/loader.cpp @@ -18,6 +18,10 @@ namespace fggl::ecs3 { void load_prototype_file( ecs3::World& world, data::Storage& storage, const std::string& name ) { auto path = storage.resolvePath( data::Data, name ); + if ( !std::filesystem::exists(path) ) { + debug::log(debug::Level::warning, "prototype file not found: {}", path.string()); + return; + } auto root = YAML::LoadFile( path.string().c_str() ); for (const auto& node : root["prefabs"] ) { -- GitLab