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