From 51ba9cb2a6b0b9395a2912eadeb954c95e4c1d3c Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 20 May 2018 23:37:11 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=AE=E5=BD=95=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/script/core/luaopen_core.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/script/core/luaopen_core.cpp') diff --git a/src/script/core/luaopen_core.cpp b/src/script/core/luaopen_core.cpp index 0d76ada..a222013 100644 --- a/src/script/core/luaopen_core.cpp +++ b/src/script/core/luaopen_core.cpp @@ -11,7 +11,7 @@ namespace lua { bool running = Game::get()->running(); luax_pushboolean(L, running); - return 1; + return 1; } static int l_quit(lua_State* L) @@ -19,10 +19,17 @@ namespace lua Game::get()->quit(); return 0; } + + static int l_exit(lua_State* L) + { + Game::get()->exit(); + return 0; + } static const luaL_Reg f[] = { {"running", l_running}, - {"quit", l_quit}, + {"quit", l_quit}, // for end game loop + {"exit", l_exit}, // for exit whole game {0, 0} }; -- cgit v1.1-26-g67d0