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

Better handling of temporary folders

This commit is contained in:
sfan5 2024-04-05 15:55:54 +02:00
parent f87994edc7
commit 7e4462e0ac
6 changed files with 34 additions and 17 deletions

View file

@ -729,7 +729,7 @@ int ModApiMainMenu::l_get_cache_path(lua_State *L)
int ModApiMainMenu::l_get_temp_path(lua_State *L)
{
if (lua_isnoneornil(L, 1) || !lua_toboolean(L, 1))
lua_pushstring(L, fs::TempPath().c_str());
lua_pushstring(L, fs::CreateTempDir().c_str());
else
lua_pushstring(L, fs::CreateTempFile().c_str());
return 1;