nn_act: Handle incorrect slot 0 for PersistentId

This commit is contained in:
Exzap 2023-07-24 19:07:13 +02:00
parent 651e5336b4
commit 67819a68d9

View File

@ -623,10 +623,19 @@ int iosuAct_thread()
} }
else if (actCemuRequest->requestCode == IOSU_ARC_PERSISTENTID) else if (actCemuRequest->requestCode == IOSU_ARC_PERSISTENTID)
{ {
accountIndex = iosuAct_getAccountIndexBySlot(actCemuRequest->accountSlot); if(actCemuRequest->accountSlot != 0)
_cancelIfAccountDoesNotExist(); {
actCemuRequest->resultU32.u32 = _actAccountData[accountIndex].persistentId; accountIndex = iosuAct_getAccountIndexBySlot(actCemuRequest->accountSlot);
actCemuRequest->setACTReturnCode(0); _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) else if (actCemuRequest->requestCode == IOSU_ARC_COUNTRY)
{ {