From bad16f7aa105ed91bf7e629077cdf1dc5740e8d7 Mon Sep 17 00:00:00 2001 From: Stanislav Denisov Date: Fri, 21 Nov 2025 16:45:40 +0100 Subject: [PATCH] Register the exit function for Lua (#1318) --- WickedEngine/wiApplication_BindLua.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/WickedEngine/wiApplication_BindLua.cpp b/WickedEngine/wiApplication_BindLua.cpp index 377440dcf..4e4280803 100644 --- a/WickedEngine/wiApplication_BindLua.cpp +++ b/WickedEngine/wiApplication_BindLua.cpp @@ -550,6 +550,16 @@ namespace wi::lua wi::profiler::SetEnabled(!wi::profiler::IsEnabled()); return 0; } + int exit(lua_State* L) + { + lua_getglobal(L, "application"); + Application_BindLua* app = Luna::lightcheck(L, -1); + if (app && app->component) + { + app->component->Exit(); + } + return 0; + } void Application_BindLua::Bind() { @@ -561,6 +571,7 @@ namespace wi::lua wi::lua::RegisterFunc("SetProfilerEnabled", SetProfilerEnabled); wi::lua::RegisterFunc("prof", prof); + wi::lua::RegisterFunc("exit", exit); wi::lua::RunText(R"( FadeType = {