mii: Fix multiple inconsistencies (#2392)
I found multiple inconsistencies while diffing with latest sdb, this PR fixes those findings.
This commit is contained in:
parent
0644db02ad
commit
e334303559
5 changed files with 44 additions and 40 deletions
|
@ -416,35 +416,35 @@ namespace Ryujinx.HLE.HOS.Services.Mii
|
|||
return ResultCode.InvalidStoreData;
|
||||
}
|
||||
|
||||
if (!metadata.MiiKeyCode.IsEnabledSpecialMii() && !storeData.IsSpecial())
|
||||
if (!metadata.MiiKeyCode.IsEnabledSpecialMii() && storeData.IsSpecial())
|
||||
{
|
||||
if (_database.GetIndexByCreatorId(out int index, storeData.CreateId))
|
||||
{
|
||||
StoreData oldStoreData = _database.Get(index);
|
||||
|
||||
if (oldStoreData.IsSpecial())
|
||||
{
|
||||
return ResultCode.InvalidOperationOnSpecialMii;
|
||||
}
|
||||
|
||||
_database.Replace(index, storeData);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_database.IsFull())
|
||||
{
|
||||
return ResultCode.DatabaseFull;
|
||||
}
|
||||
|
||||
_database.Add(storeData);
|
||||
}
|
||||
|
||||
MarkDirty(metadata);
|
||||
|
||||
return ResultCode.Success;
|
||||
return ResultCode.InvalidOperationOnSpecialMii;
|
||||
}
|
||||
|
||||
return ResultCode.InvalidOperationOnSpecialMii;
|
||||
if (_database.GetIndexByCreatorId(out int index, storeData.CreateId))
|
||||
{
|
||||
StoreData oldStoreData = _database.Get(index);
|
||||
|
||||
if (oldStoreData.IsSpecial())
|
||||
{
|
||||
return ResultCode.InvalidOperationOnSpecialMii;
|
||||
}
|
||||
|
||||
_database.Replace(index, storeData);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_database.IsFull())
|
||||
{
|
||||
return ResultCode.DatabaseFull;
|
||||
}
|
||||
|
||||
_database.Add(storeData);
|
||||
}
|
||||
|
||||
MarkDirty(metadata);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
public ResultCode Delete(DatabaseSessionMetadata metadata, CreateId createId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue