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

Ban Lua debug lib (#419)

parent 4d1fc22e
...@@ -28,6 +28,8 @@ interpreter::interpreter(duel* pd): coroutines(256) { ...@@ -28,6 +28,8 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setglobal(lua_state, "os"); lua_setglobal(lua_state, "os");
lua_pushnil(lua_state); lua_pushnil(lua_state);
lua_setglobal(lua_state, "package"); lua_setglobal(lua_state, "package");
lua_pushnil(lua_state);
lua_setglobal(lua_state, "debug");
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");
...@@ -35,6 +37,8 @@ interpreter::interpreter(duel* pd): coroutines(256) { ...@@ -35,6 +37,8 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setfield(lua_state, -2, "os"); lua_setfield(lua_state, -2, "os");
lua_pushnil(lua_state); lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "package"); lua_setfield(lua_state, -2, "package");
lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "debug");
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