aboutsummaryrefslogtreecommitdiff
path: root/src/server/lua_api/load_game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/lua_api/load_game.cpp')
-rw-r--r--src/server/lua_api/load_game.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/server/lua_api/load_game.cpp b/src/server/lua_api/load_game.cpp
new file mode 100644
index 0000000..4464dd7
--- /dev/null
+++ b/src/server/lua_api/load_game.cpp
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <vector>
+#include <map>
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+
+extern bool game_active;
+
+//exit()
+int exit_game(lua_State *L){
+ game_active = false;
+ return 0;
+}
+
+void load_gamefuncs(lua_State* L){
+ lua_newtable(L);
+ lua_setglobal(L,"GAME");
+
+ lua_getglobal(L,"GAME");
+ lua_pushcfunction(L,exit_game);
+ lua_setfield(L,-2,"exit");
+ lua_pop(L,1);
+}