mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 17:39:46 +00:00
Merge branch 'main' into release-0.32
Some checks failed
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Has been cancelled
Macos Build / build-dmg (push) Has been cancelled
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Has been cancelled
MSVC Build / build-windows (windows-2022) (push) Has been cancelled
Some checks failed
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Has been cancelled
Macos Build / build-dmg (push) Has been cancelled
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Has been cancelled
MSVC Build / build-windows (windows-2022) (push) Has been cancelled
This commit is contained in:
commit
b0356e1070
3 changed files with 12 additions and 2 deletions
|
|
@ -29,10 +29,14 @@ end
|
|||
local __vc__app_script_coroutine
|
||||
|
||||
local function complete_app_lib(app)
|
||||
local tick_required = true
|
||||
local __app_load_content = app.load_content
|
||||
local __app_reset_content = app.reset_content
|
||||
local __app_reconfig_packs = app.reconfig_packs
|
||||
local __app_tick = coroutine.yield
|
||||
local __app_tick = function ()
|
||||
coroutine.yield()
|
||||
tick_required = false
|
||||
end
|
||||
local __app_set_setting = app.set_setting
|
||||
local __app_quit = app.quit
|
||||
|
||||
|
|
@ -50,6 +54,9 @@ local function complete_app_lib(app)
|
|||
func(...)
|
||||
return
|
||||
end
|
||||
if tick_required then
|
||||
__app_tick()
|
||||
end
|
||||
local running = coroutine.running()
|
||||
if not running or running ~= __vc__app_script_coroutine then
|
||||
error("content must be reload in application script coroutine")
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ AppScriptsControl::AppScriptsControl(const CoreParameters& params) {
|
|||
if (io::exists(scriptFile)) {
|
||||
logger.info() << "starting script: " << params.scriptFile.u8string();
|
||||
scriptCoroutine = scripting::start_app_script(scriptFile);
|
||||
if (scriptCoroutine) {
|
||||
scriptCoroutine->update();
|
||||
}
|
||||
} else {
|
||||
logger.warning() << "script does not exists: " << params.scriptFile.u8string();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ static int l_set(lua::State* L) {
|
|||
|
||||
auto chunksController = controller->getChunksController();
|
||||
if (chunksController == nullptr) {
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
if (chunksController->lighting) {
|
||||
Lighting& lighting = *chunksController->lighting;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue