Skip to content

Commit

Permalink
support YGOPRO_NO_LUA_SAFE
Browse files Browse the repository at this point in the history
  • Loading branch information
purerosefallen committed May 21, 2024
1 parent bddfb7b commit 4367d7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ interpreter::interpreter(duel* pd): coroutines(256) {
no_action = 0;
call_depth = 0;
//Initial
#ifdef YGOPRO_NO_LUA_SAFE
luaL_openlibs(lua_state);
#else
luaL_requiref(lua_state, "base", luaopen_base, 0);
lua_pop(lua_state, 1);
luaL_requiref(lua_state, "string", luaopen_string, 1);
Expand All @@ -32,6 +35,7 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_pop(lua_state, 1);
luaL_requiref(lua_state, "math", luaopen_math, 1);
lua_pop(lua_state, 1);
#endif
//open all libs
scriptlib::open_cardlib(lua_state);
scriptlib::open_effectlib(lua_state);
Expand Down

0 comments on commit 4367d7a

Please sign in to comment.