Skip to content
Snippets Groups Projects
Commit 9afe7868 authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

deal with crash when unknown types are encounted

parent 44d98299
No related branches found
No related tags found
No related merge requests found
......@@ -142,20 +142,19 @@ namespace fggl::ds {
auto myDeps = m_edges.at(idx);
for (auto& dep : myDeps) {
if ( m_edges.find(dep) == m_edges.end() ) {
debug::warning("dependency was in graph, but does not exist as vertex: {}", dep.get());
continue;
}
assert( m_edges.contains(dep) );
// ensure dependency loops don't cause errors
if ( visited.contains(dep) ) {
debug::warning("Dependency loop detected, aborting");
continue;
}
sortUtilRev(dep, visited, stack);
// if this node exists in the graph, fetch its dependencies to
if ( m_edges.contains(dep) ) {
sortUtilRev(dep, visited, stack);
} else {
// !? we don't know about this asset but someone wants it, stick it in the queue
// this will probably cause an error when chain loading, but then it will let people
// know it's missing.
stack.push(dep);
}
}
stack.push(idx);
......
......@@ -37,6 +37,7 @@ namespace fggl::script::lua {
struct Lua : public services::Module {
FGGL_MODULE(fggl::script::Lua, fggl::filesystem::API)
void setup(services::Generator*) override;
void wireServices(services::ModuleBinder& binder) override;
};
......
......@@ -28,12 +28,13 @@ namespace fggl::script::lua {
return assets::INVALID_ASSET_TYPE;
}
void Lua::setup(fggl::services::Generator *generator) {
auto adapted = generator->getLazy<assets::CheckinAdapted>();
adapted->setLoader(MIME_LUA, assets::NEEDS_CHECKIN, is_lua);
}
void Lua::wireServices(services::ModuleBinder &binder) {
binder.bind<ScriptProvider>().to<LuaScriptProvider, fggl::filesystem::Locator>();
//TODO
//auto *assetPacker = serviceManager.get<assets::CheckinAdapted>();
//assetPacker->setLoader(MIME_LUA, assets::NEEDS_CHECKIN, is_lua);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment