aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Pickering <alex@cogarr.net>2018-10-31 12:43:59 -0400
committerAlexander Pickering <alex@cogarr.net>2018-10-31 12:43:59 -0400
commit9e9be703c8f1c58c76fd2051dd6fa6ce49a7a306 (patch)
tree4df0478902e8653e91139764d5964831dcb9b525 /src
parent6e5697a125973bca83d368364e088777d23f824a (diff)
downloadbrokengine-9e9be703c8f1c58c76fd2051dd6fa6ce49a7a306.tar.gz
brokengine-9e9be703c8f1c58c76fd2051dd6fa6ce49a7a306.tar.bz2
brokengine-9e9be703c8f1c58c76fd2051dd6fa6ce49a7a306.zip
Started on unit tests
Added a GAME.exit() function Added some bare bones unit tests
Diffstat (limited to 'src')
-rw-r--r--src/client/lua_api/load_game.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/lua_api/load_game.cpp b/src/client/lua_api/load_game.cpp
index 92cb2d5..469b219 100644
--- a/src/client/lua_api/load_game.cpp
+++ b/src/client/lua_api/load_game.cpp
@@ -18,7 +18,20 @@ using namespace irr;
using namespace gui;
using namespace core;
+extern IrrlichtDevice* device;
+
+//exit()
+int exit_game(lua_State *L){
+ device->closeDevice();
+ 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);
}