summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorChloe <25727384+ogniK5377@users.noreply.github.com>2021-06-03 02:46:29 +0200
committerGitHub <noreply@github.com>2021-06-03 02:46:29 +0200
commitc4c256f56ad4db7064aa2a2bc769f57efcbd5e38 (patch)
tree2aeb68fb1c51198071a4b340db69f9f9d453729d /src/core/file_sys
parentMerge pull request #6308 from Morph1984/result (diff)
downloadyuzu-c4c256f56ad4db7064aa2a2bc769f57efcbd5e38.tar
yuzu-c4c256f56ad4db7064aa2a2bc769f57efcbd5e38.tar.gz
yuzu-c4c256f56ad4db7064aa2a2bc769f57efcbd5e38.tar.bz2
yuzu-c4c256f56ad4db7064aa2a2bc769f57efcbd5e38.tar.lz
yuzu-c4c256f56ad4db7064aa2a2bc769f57efcbd5e38.tar.xz
yuzu-c4c256f56ad4db7064aa2a2bc769f57efcbd5e38.tar.zst
yuzu-c4c256f56ad4db7064aa2a2bc769f57efcbd5e38.zip
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/savedata_factory.cpp6
-rw-r--r--src/core/file_sys/savedata_factory.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp
index 6c3685927..b5254dd75 100644
--- a/src/core/file_sys/savedata_factory.cpp
+++ b/src/core/file_sys/savedata_factory.cpp
@@ -105,7 +105,7 @@ ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space,
auto out = dir->GetDirectoryRelative(save_directory);
- if (out == nullptr && ShouldSaveDataBeAutomaticallyCreated(space, meta)) {
+ if (out == nullptr && (ShouldSaveDataBeAutomaticallyCreated(space, meta) && auto_create)) {
return Create(space, meta);
}
@@ -199,4 +199,8 @@ void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 us
size_file->WriteObject(new_value);
}
+void SaveDataFactory::SetAutoCreate(bool state) {
+ auto_create = state;
+}
+
} // namespace FileSys
diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h
index 86c9f5350..1d8dc981f 100644
--- a/src/core/file_sys/savedata_factory.h
+++ b/src/core/file_sys/savedata_factory.h
@@ -104,9 +104,12 @@ public:
void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id,
SaveDataSize new_value) const;
+ void SetAutoCreate(bool state);
+
private:
VirtualDir dir;
Core::System& system;
+ bool auto_create{true};
};
} // namespace FileSys