diff options
author | Alex Barney <thealexbarney@gmail.com> | 2022-02-02 14:49:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 14:49:49 -0700 |
commit | d317cfd639bde1e22970799181adec5f37573995 (patch) | |
tree | 8af517e9de200c068cc5946003f069e4ad4709ac | |
parent | 76b9041adf12e8bc692a489d0081791a93932a32 (diff) |
Try to ensure save data always has a valid owner ID (#3057)1.1.16
- Run the extra data fix in FixExtraData on non-system saves that have no owner ID.
- Set the owner ID in the dummy application control property if an application doesn't have a proper one available.
-rw-r--r-- | Ryujinx.HLE/FileSystem/VirtualFileSystem.cs | 4 | ||||
-rw-r--r-- | Ryujinx.HLE/HOS/ApplicationLoader.cs | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs index f2d20cb1..9359b03c 100644 --- a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs +++ b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs @@ -505,7 +505,9 @@ namespace Ryujinx.HLE.FileSystem bool canFixBySaveDataId = extraData.Attribute.StaticSaveDataId == 0 && info.StaticSaveDataId != 0; - if (!canFixByProgramId && !canFixBySaveDataId) + bool hasEmptyOwnerId = extraData.OwnerId == 0 && info.Type != LibHac.Fs.SaveDataType.System; + + if (!canFixByProgramId && !canFixBySaveDataId && !hasEmptyOwnerId) { wasFixNeeded = false; return Result.Success; diff --git a/Ryujinx.HLE/HOS/ApplicationLoader.cs b/Ryujinx.HLE/HOS/ApplicationLoader.cs index 8ceed5ea..65448d5d 100644 --- a/Ryujinx.HLE/HOS/ApplicationLoader.cs +++ b/Ryujinx.HLE/HOS/ApplicationLoader.cs @@ -776,6 +776,7 @@ namespace Ryujinx.HLE.HOS // The set sizes don't actually matter as long as they're non-zero because we use directory savedata. control.UserAccountSaveDataSize = 0x4000; control.UserAccountSaveDataJournalSize = 0x4000; + control.SaveDataOwnerId = applicationId; Logger.Warning?.Print(LogClass.Application, "No control file was found for this game. Using a dummy one instead. This may cause inaccuracies in some games."); |