diff options
| author | 2018-07-10 09:09:58 -0700 | |
|---|---|---|
| committer | 2018-07-10 09:09:58 -0700 | |
| commit | 3e966be6fcab0fd7d3ce8f9645dd6c42355c5632 (patch) | |
| tree | 1b5c09fd62f2510ec488dfacf4ce875f3c7aef4d /src | |
| parent | Merge pull request #636 from FearlessTobi/add-gitignore (diff) | |
| parent | savedata_factory: Always create a save directory for games. (diff) | |
| download | yuzu-3e966be6fcab0fd7d3ce8f9645dd6c42355c5632.tar.gz yuzu-3e966be6fcab0fd7d3ce8f9645dd6c42355c5632.tar.xz yuzu-3e966be6fcab0fd7d3ce8f9645dd6c42355c5632.zip | |
Merge pull request #642 from bunnei/create-save-dir
savedata_factory: Always create a save directory for games.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 9 |
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) | |||
| 17 | 17 | ||
| 18 | ResultVal<std::unique_ptr<FileSystemBackend>> SaveData_Factory::Open(const Path& path) { | 18 | ResultVal<std::unique_ptr<FileSystemBackend>> SaveData_Factory::Open(const Path& path) { |
| 19 | std::string save_directory = GetFullPath(); | 19 | std::string save_directory = GetFullPath(); |
| 20 | |||
| 21 | if (!FileUtil::Exists(save_directory)) { | ||
| 22 | // TODO(bunnei): This is a work-around to always create a save data directory if it does not | ||
| 23 | // already exist. This is a hack, as we do not understand yet how this works on hardware. | ||
| 24 | // Without a save data directory, many games will assert on boot. This should not have any | ||
| 25 | // bad side-effects. | ||
| 26 | FileUtil::CreateFullPath(save_directory); | ||
| 27 | } | ||
| 28 | |||
| 20 | // Return an error if the save data doesn't actually exist. | 29 | // Return an error if the save data doesn't actually exist. |
| 21 | if (!FileUtil::IsDirectory(save_directory)) { | 30 | if (!FileUtil::IsDirectory(save_directory)) { |
| 22 | // TODO(Subv): Find out correct error code. | 31 | // TODO(Subv): Find out correct error code. |