diff options
| author | Alexander Pickering <alex@cogarr.net> | 2018-10-31 12:43:59 -0400 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2018-10-31 12:43:59 -0400 |
| commit | 9e9be703c8f1c58c76fd2051dd6fa6ce49a7a306 (patch) | |
| tree | 4df0478902e8653e91139764d5964831dcb9b525 /src | |
| parent | 6e5697a125973bca83d368364e088777d23f824a (diff) | |
| download | brokengine-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.cpp | 13 |
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); } |
