Skip to content

Commit

Permalink
nn_act: Handle incorrect slot 0 for PersistentId
Browse files Browse the repository at this point in the history
  • Loading branch information
Exzap committed Aug 3, 2023
1 parent 651e533 commit 67819a6
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/Cafe/IOSU/legacy/iosu_act.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,10 +623,19 @@ int iosuAct_thread()
}
else if (actCemuRequest->requestCode == IOSU_ARC_PERSISTENTID)
{
accountIndex = iosuAct_getAccountIndexBySlot(actCemuRequest->accountSlot);
_cancelIfAccountDoesNotExist();
actCemuRequest->resultU32.u32 = _actAccountData[accountIndex].persistentId;
actCemuRequest->setACTReturnCode(0);
if(actCemuRequest->accountSlot != 0)
{
accountIndex = iosuAct_getAccountIndexBySlot(actCemuRequest->accountSlot);
_cancelIfAccountDoesNotExist();
actCemuRequest->resultU32.u32 = _actAccountData[accountIndex].persistentId;
actCemuRequest->setACTReturnCode(0);
}
else
{
// F1 Race Stars calls IsSlotOccupied and indirectly GetPersistentId on slot 0 which is not valid
actCemuRequest->resultU32.u32 = 0;
actCemuRequest->setACTReturnCode(0);
}
}
else if (actCemuRequest->requestCode == IOSU_ARC_COUNTRY)
{
Expand Down

0 comments on commit 67819a6

Please sign in to comment.