aboutsummaryrefslogtreecommitdiff
path: root/src/server/lua_api/load_game.cpp
blob: 4464dd713e51589ac58d6eeec2f58ecabec5967b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
}