From 9e9be703c8f1c58c76fd2051dd6fa6ce49a7a306 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Wed, 31 Oct 2018 12:43:59 -0400 Subject: Started on unit tests Added a GAME.exit() function Added some bare bones unit tests --- src/client/lua_api/load_game.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/client') 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); } -- cgit v1.2.3-70-g09d2