From d631f21024bac626babe2e8eac4505210d368ffa Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Sat, 23 Jul 2022 16:27:07 -0400 Subject: Let core.get_mod_storage be called multiple times (#12572) --- src/script/lua_api/l_storage.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/script/lua_api/l_storage.cpp b/src/script/lua_api/l_storage.cpp index b8f4347a8..b6c53e353 100644 --- a/src/script/lua_api/l_storage.cpp +++ b/src/script/lua_api/l_storage.cpp @@ -25,12 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc., int ModApiStorage::l_get_mod_storage(lua_State *L) { - lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_CURRENT_MOD_NAME); - if (!lua_isstring(L, -1)) { - return 0; - } - - std::string mod_name = readParam(L, -1); + // Note that this is wrapped in Lua, see builtin/common/mod_storage.lua + std::string mod_name = readParam(L, 1); ModMetadata *store = nullptr; -- cgit v1.2.3