Quick fix - create dynos/mods directories if they don't exist
This commit is contained in:
parent
a1e12aa5e0
commit
dbbea81851
|
@ -92,11 +92,18 @@ static bool mod_import_zip(char* path, bool* isLua, bool* isDynos) {
|
||||||
if (*isLua) {
|
if (*isLua) {
|
||||||
snprintf(dstDirectory, SYS_MAX_PATH, "%s", (char*)fs_get_write_path(MOD_DIRECTORY));
|
snprintf(dstDirectory, SYS_MAX_PATH, "%s", (char*)fs_get_write_path(MOD_DIRECTORY));
|
||||||
} else if (*isDynos) {
|
} 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));
|
snprintf(dstDirectory, SYS_MAX_PATH, "%s", (char*)fs_get_write_path(DYNOS_PACKS_FOLDER));
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("Could not figure out what type of mod this is");
|
LOG_ERROR("Could not figure out what type of mod this is");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!fs_sys_dir_exists(dstDirectory)) {
|
||||||
|
fs_sys_mkdir(dstDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
// Extract the archive
|
// Extract the archive
|
||||||
for (int i = 0; i < (int)mz_zip_reader_get_num_files(&zip_archive); i++) {
|
for (int i = 0; i < (int)mz_zip_reader_get_num_files(&zip_archive); i++) {
|
||||||
|
|
Loading…
Reference in New Issue