mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 06:50:04 +00:00
added globalState; minor styling fixes
This commit is contained in:
parent
95f2920f5c
commit
450cc78c9a
@ -2,8 +2,11 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace LuaManager {
|
using namespace LuaManager;
|
||||||
void init() {
|
|
||||||
|
static lua_State *globalState = nullptr;
|
||||||
|
|
||||||
|
void init() {
|
||||||
lua_State *L = luaL_newstate();
|
lua_State *L = luaL_newstate();
|
||||||
luaL_openlibs(L);
|
luaL_openlibs(L);
|
||||||
|
|
||||||
@ -11,5 +14,6 @@ namespace LuaManager {
|
|||||||
std::cout << "Lua error: " << lua_tostring(L, -1) << std::endl;
|
std::cout << "Lua error: " << lua_tostring(L, -1) << std::endl;
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
globalState = L;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user