From 0aab42a27e89ebe39bbe73fdc60f9881ac36ca40 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 9 Apr 2023 18:53:32 -0700 Subject: [PATCH] Quick fix - create dynos/mods directories if they don't exist --- src/pc/mods/mod_import.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pc/mods/mod_import.c b/src/pc/mods/mod_import.c index 5d38a7ef..ce2ad599 100644 --- a/src/pc/mods/mod_import.c +++ b/src/pc/mods/mod_import.c @@ -92,11 +92,18 @@ static bool mod_import_zip(char* path, bool* isLua, bool* isDynos) { if (*isLua) { snprintf(dstDirectory, SYS_MAX_PATH, "%s", (char*)fs_get_write_path(MOD_DIRECTORY)); } else if (*isDynos) { + char* dynosPath = (char*)fs_get_write_path(DYNOS_RES_FOLDER); + if (!fs_sys_dir_exists(dynosPath)) { + fs_sys_mkdir(dynosPath); + } snprintf(dstDirectory, SYS_MAX_PATH, "%s", (char*)fs_get_write_path(DYNOS_PACKS_FOLDER)); } else { LOG_ERROR("Could not figure out what type of mod this is"); return false; } + if (!fs_sys_dir_exists(dstDirectory)) { + fs_sys_mkdir(dstDirectory); + } // Extract the archive for (int i = 0; i < (int)mz_zip_reader_get_num_files(&zip_archive); i++) {