Commit ad021d17 authored by DailyShana's avatar DailyShana

disable io and os library correctly

parent 60e18710
......@@ -603,11 +603,15 @@ interpreter::interpreter(duel* pd): coroutines(256) {
//Initial
luaL_openlibs(lua_state);
lua_pushnil(lua_state);
lua_setglobal(lua_state, "file");
lua_pushnil(lua_state);
lua_setglobal(lua_state, "io");
lua_pushnil(lua_state);
lua_setglobal(lua_state, "os");
luaL_getsubtable(lua_state, LUA_REGISTRYINDEX, LUA_LOADED_TABLE);
lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "io");
luaL_getsubtable(lua_state, LUA_REGISTRYINDEX, LUA_LOADED_TABLE);
lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "os");
//open all libs
luaL_newlib(lua_state, cardlib);
lua_pushstring(lua_state, "__index");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment