aboutsummaryrefslogtreecommitdiff
path: root/src/script/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/core')
-rw-r--r--src/script/core/luaopen_core.cpp11
1 files changed, 9 insertions, 2 deletions
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}
};