summaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-07-23 16:27:07 -0400
committerGitHub <noreply@github.com>2022-07-23 22:27:07 +0200
commitd631f21024bac626babe2e8eac4505210d368ffa (patch)
treee6f929193cf2cb7751543fe2a6950a13d4798d98 /src/script/lua_api
parent2351c9561265d4136f78ce3dd73c0c77acfed711 (diff)
downloadminetest-d631f21024bac626babe2e8eac4505210d368ffa.tar.gz
minetest-d631f21024bac626babe2e8eac4505210d368ffa.tar.bz2
minetest-d631f21024bac626babe2e8eac4505210d368ffa.zip
Let core.get_mod_storage be called multiple times (#12572)
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_storage.cpp8
1 files changed, 2 insertions, 6 deletions
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<std::string>(L, -1);
+ // Note that this is wrapped in Lua, see builtin/common/mod_storage.lua
+ std::string mod_name = readParam<std::string>(L, 1);
ModMetadata *store = nullptr;