Merge branch 'main' into dev
This commit is contained in:
commit
1f896d7fa6
@ -36,7 +36,6 @@ local function complete_app_lib(app)
|
||||
app.set_setting = core.set_setting
|
||||
app.tick = function()
|
||||
coroutine.yield()
|
||||
network.__process_events()
|
||||
end
|
||||
app.get_version = core.get_version
|
||||
app.get_setting_info = core.get_setting_info
|
||||
@ -612,6 +611,8 @@ function __process_post_runnables()
|
||||
for _, name in ipairs(dead) do
|
||||
__vc_named_coroutines[name] = nil
|
||||
end
|
||||
|
||||
network.__process_events()
|
||||
end
|
||||
|
||||
function time.post_runnable(runnable)
|
||||
|
||||
@ -416,19 +416,20 @@ void ContentLoader::load() {
|
||||
|
||||
template <class T>
|
||||
static void load_script(const Content& content, T& def) {
|
||||
const auto& name = def.name;
|
||||
size_t pos = name.find(':');
|
||||
const auto& scriptName = def.scriptFile;
|
||||
if (scriptName.empty()) return;
|
||||
size_t pos = scriptName.find(':');
|
||||
if (pos == std::string::npos) {
|
||||
throw std::runtime_error("invalid content unit name");
|
||||
}
|
||||
const auto runtime = content.getPackRuntime(name.substr(0, pos));
|
||||
const auto runtime = content.getPackRuntime(scriptName.substr(0, pos));
|
||||
const auto& pack = runtime->getInfo();
|
||||
const auto& folder = pack.folder;
|
||||
auto scriptfile = folder / ("scripts/" + def.scriptName + ".lua");
|
||||
if (io::is_regular_file(scriptfile)) {
|
||||
scripting::load_content_script(
|
||||
runtime->getEnvironment(),
|
||||
name,
|
||||
def.name,
|
||||
scriptfile,
|
||||
def.scriptFile,
|
||||
def.rt.funcsset
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user