From 67819a68d927b22d573ec8e73cae75a70766f27f Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:07:13 +0200 Subject: [PATCH] nn_act: Handle incorrect slot 0 for PersistentId --- src/Cafe/IOSU/legacy/iosu_act.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Cafe/IOSU/legacy/iosu_act.cpp b/src/Cafe/IOSU/legacy/iosu_act.cpp index fa683c1e..919b7b0f 100644 --- a/src/Cafe/IOSU/legacy/iosu_act.cpp +++ b/src/Cafe/IOSU/legacy/iosu_act.cpp @@ -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) {