summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_mainmenu.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-09-19 16:55:35 +0200
committersfan5 <sfan5@live.de>2021-10-07 00:20:01 +0200
commit2d5b7b5fb48d182fbab8e4ad69e9a552a3c07c6e (patch)
tree804a2a86365861f0ca7fecf4d718d2d53115e34e /src/script/lua_api/l_mainmenu.cpp
parent9fab5d594cab4c0a027f0aecf356382f3a37c1de (diff)
downloadminetest-2d5b7b5fb48d182fbab8e4ad69e9a552a3c07c6e.tar.gz
minetest-2d5b7b5fb48d182fbab8e4ad69e9a552a3c07c6e.tar.bz2
minetest-2d5b7b5fb48d182fbab8e4ad69e9a552a3c07c6e.zip
Make fs::extractZipFile thread-safe
Diffstat (limited to 'src/script/lua_api/l_mainmenu.cpp')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index 57fddc0be..4cfbaec71 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -644,9 +644,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, fs::extractZipFile(rendering_engine->get_filesystem(), zipfile, destination));
+ auto fs = RenderingEngine::get_raw_device()->getFileSystem();
+ bool ok = fs::extractZipFile(fs, zipfile, destination);
+ lua_pushboolean(L, ok);
return 1;
}
@@ -916,7 +916,7 @@ void ModApiMainMenu::InitializeAsync(lua_State *L, int top)
API_FCT(delete_dir);
API_FCT(copy_dir);
API_FCT(is_dir);
- //API_FCT(extract_zip); //TODO remove dependency to GuiEngine
+ API_FCT(extract_zip);
API_FCT(may_modify_path);
API_FCT(download_file);
API_FCT(get_min_supp_proto);