1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

fix: extractZipFile is not part of Client but more generic.

This solve a crash from mainmenu while extracting the zip
This commit is contained in:
Loic Blot 2021-05-06 09:02:11 +02:00 committed by Loïc Blot
parent ba40b39500
commit 225d4541ff
5 changed files with 72 additions and 69 deletions

View file

@ -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;
}