Log missing scripts
This commit is contained in:
parent
2185e87eb2
commit
65bacddc67
@ -111,8 +111,14 @@ LuaContext LuaRoot::createContext(StringList const& scriptPaths) {
|
|||||||
return newContext.engine().createFunctionFromSource(newContext.handleIndex(), source.utf8Ptr(), source.utf8Size(), functionName.utf8Ptr());
|
return newContext.engine().createFunctionFromSource(newContext.handleIndex(), source.utf8Ptr(), source.utf8Size(), functionName.utf8Ptr());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
for (auto const& scriptPath : scriptPaths)
|
auto assets = Root::singleton().assets();
|
||||||
|
|
||||||
|
for (auto const& scriptPath : scriptPaths) {
|
||||||
|
if (assets->assetExists(scriptPath))
|
||||||
cache->loadContextScript(newContext, scriptPath);
|
cache->loadContextScript(newContext, scriptPath);
|
||||||
|
else
|
||||||
|
Logger::error("Script '{}' does not exist", scriptPath);
|
||||||
|
}
|
||||||
|
|
||||||
for (auto const& callbackPair : m_luaCallbacks)
|
for (auto const& callbackPair : m_luaCallbacks)
|
||||||
newContext.setCallbacks(callbackPair.first, callbackPair.second);
|
newContext.setCallbacks(callbackPair.first, callbackPair.second);
|
||||||
|
Loading…
Reference in New Issue
Block a user