From 8729e0dfd8d8354c1c3a320646e04425363150a7 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 14 Dec 2024 21:03:44 +0200 Subject: [PATCH] ExtSaveData: Fix error codes & always create user/boss directories --- src/core/fs/archive_ext_save_data.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/fs/archive_ext_save_data.cpp b/src/core/fs/archive_ext_save_data.cpp index 0fb62629..803c132b 100644 --- a/src/core/fs/archive_ext_save_data.cpp +++ b/src/core/fs/archive_ext_save_data.cpp @@ -210,11 +210,12 @@ void ExtSaveDataArchive::format(const FSPath& path, const FormatInfo& info) { if (!isShared) { // Delete all contents by deleting the directory then recreating it fs::remove_all(saveDataPath); - fs::create_directories(saveDataPath); - fs::create_directories(saveDataPath / "user"); - fs::create_directories(saveDataPath / "boss"); } + fs::create_directories(saveDataPath); + fs::create_directories(saveDataPath / "user"); + fs::create_directories(saveDataPath / "boss"); + // Write format info on disk IOFile file(formatInfoPath, "wb"); file.writeBytes(&info, sizeof(info)); @@ -248,7 +249,7 @@ Rust::Result ExtSaveDataArchive::getForm // If the file failed to open somehow, we return that the archive is not formatted if (!file.isOpen()) { - return Err(Result::FS::NotFormatted); + return isShared ? Err(Result::FS::NotFormatted) : Err(Result::FS::NotFoundInvalid); } FormatInfo ret = {};