aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2021-05-06 09:02:11 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2021-05-06 16:01:52 +0200
commit225d4541ffb4d59001841747e0877a175da50c17 (patch)
treec6c7a0de449da5f9ab3390b16d0322e87a20ef82 /src/script/lua_api
parentba40b3950057c54609f8e4a56139563d30f8b84f (diff)
downloadminetest-225d4541ffb4d59001841747e0877a175da50c17.tar.gz
minetest-225d4541ffb4d59001841747e0877a175da50c17.tar.bz2
minetest-225d4541ffb4d59001841747e0877a175da50c17.zip
fix: extractZipFile is not part of Client but more generic.
This solve a crash from mainmenu while extracting the zip
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index b13398539..ee3e72dea 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -628,8 +628,9 @@ int ModApiMainMenu::l_extract_zip(lua_State *L)
std::string absolute_destination = fs::RemoveRelativePathComponents(destination);
if (ModApiMainMenu::mayModifyPath(absolute_destination)) {
+ auto rendering_engine = getGuiEngine(L)->m_rendering_engine;
fs::CreateAllDirs(absolute_destination);
- lua_pushboolean(L, getClient(L)->extractZipFile(zipfile, destination));
+ lua_pushboolean(L, fs::extractZipFile(rendering_engine->get_filesystem(), zipfile, destination));
return 1;
}