Commit ee3f6ebe authored by nanahira's avatar nanahira Committed by GitHub

Disable `package` lib (#415)

for https://github.com/Fluorohydride/ygopro/issues/2378
`debug` lib is to be considered, just for `GetID`.
parent 2b5bc979
...@@ -26,11 +26,15 @@ interpreter::interpreter(duel* pd): coroutines(256) { ...@@ -26,11 +26,15 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setglobal(lua_state, "io"); lua_setglobal(lua_state, "io");
lua_pushnil(lua_state); lua_pushnil(lua_state);
lua_setglobal(lua_state, "os"); lua_setglobal(lua_state, "os");
lua_pushnil(lua_state);
lua_setglobal(lua_state, "package");
luaL_getsubtable(lua_state, LUA_REGISTRYINDEX, "_LOADED"); luaL_getsubtable(lua_state, LUA_REGISTRYINDEX, "_LOADED");
lua_pushnil(lua_state); lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "io"); lua_setfield(lua_state, -2, "io");
lua_pushnil(lua_state); lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "os"); lua_setfield(lua_state, -2, "os");
lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "package");
lua_pop(lua_state, 1); lua_pop(lua_state, 1);
//open all libs //open all libs
scriptlib::open_cardlib(lua_state); scriptlib::open_cardlib(lua_state);
......
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