Consertado spawn do mapa 2
[Projeto-PCG.git] / luaenv.cpp
blob2396d38739e830bf3fb48db7595d722f4a2c8a6d
1 #include "luaenv.h"
3 lua_State* newState() {
4 lua_State* l = lua_open();
5 luaL_openlibs(l);
6 return l;
9 void doLuaFile(lua_State* l,std::string file) {
10 if (luaL_dofile(l, file.c_str())) {
11 printf("%s\n", lua_tostring(l, -1));
15 void registerFunction(lua_State* l, std::string name, lua_CFunction function) {
16 lua_pushcfunction(l, function);
17 lua_setglobal(l, name.c_str());