summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-08 23:05:13 +0200
committerbunnei <bunneidev@gmail.com>2018-07-08 23:05:13 +0200
commiteb6cbfdbd8996401d3b595a7aa14c6361b3c6565 (patch)
treec3aba1b6c17ccff7a50c39dc575cda3599f7b458 /src/core
parentMerge pull request #625 from Subv/imnmx (diff)
downloadyuzu-eb6cbfdbd8996401d3b595a7aa14c6361b3c6565.tar
yuzu-eb6cbfdbd8996401d3b595a7aa14c6361b3c6565.tar.gz
yuzu-eb6cbfdbd8996401d3b595a7aa14c6361b3c6565.tar.bz2
yuzu-eb6cbfdbd8996401d3b595a7aa14c6361b3c6565.tar.lz
yuzu-eb6cbfdbd8996401d3b595a7aa14c6361b3c6565.tar.xz
yuzu-eb6cbfdbd8996401d3b595a7aa14c6361b3c6565.tar.zst
yuzu-eb6cbfdbd8996401d3b595a7aa14c6361b3c6565.zip
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/savedata_factory.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp
index d78baf9c3..f3aa213af 100644
--- a/src/core/file_sys/savedata_factory.cpp
+++ b/src/core/file_sys/savedata_factory.cpp
@@ -17,6 +17,15 @@ SaveData_Factory::SaveData_Factory(std::string nand_directory)
ResultVal<std::unique_ptr<FileSystemBackend>> SaveData_Factory::Open(const Path& path) {
std::string save_directory = GetFullPath();
+
+ if (!FileUtil::Exists(save_directory)) {
+ // TODO(bunnei): This is a work-around to always create a save data directory if it does not
+ // already exist. This is a hack, as we do not understand yet how this works on hardware.
+ // Without a save data directory, many games will assert on boot. This should not have any
+ // bad side-effects.
+ FileUtil::CreateFullPath(save_directory);
+ }
+
// Return an error if the save data doesn't actually exist.
if (!FileUtil::IsDirectory(save_directory)) {
// TODO(Subv): Find out correct error code.