Quick fix - create dynos/mods directories if they don't exist

This commit is contained in:
MysterD 2023-04-09 18:53:32 -07:00
parent a1e12aa5e0
commit dbbea81851
1 changed files with 7 additions and 0 deletions

View File

@ -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++) {