diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 0e096111c0..cade794e08 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -683,6 +683,7 @@ int __KernelRegisterActionType(ActionCreator creator) void __KernelRestoreActionType(int actionType, ActionCreator creator) { + _assert_(actionType >= 0); mipsCalls.restoreActionType(actionType, creator); } diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index d1ad7e15e5..7ea5500995 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -244,7 +244,9 @@ void __NetDoState(PointerWrap &p) { Do(p, netApctlState); Do(p, netApctlInfo); Do(p, actionAfterApctlMipsCall); - __KernelRestoreActionType(actionAfterApctlMipsCall, AfterApctlMipsCall::Create); + if (actionAfterApctlMipsCall != -1) { + __KernelRestoreActionType(actionAfterApctlMipsCall, AfterApctlMipsCall::Create); + } Do(p, apctlThreadHackAddr); Do(p, apctlThreadID); } diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index 496a3a892b..683f0878ef 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -650,7 +650,9 @@ void __NetAdhocDoState(PointerWrap &p) { if (s >= 2) { Do(p, actionAfterMatchingMipsCall); - __KernelRestoreActionType(actionAfterMatchingMipsCall, AfterMatchingMipsCall::Create); + if (actionAfterMatchingMipsCall != -1) { + __KernelRestoreActionType(actionAfterMatchingMipsCall, AfterMatchingMipsCall::Create); + } Do(p, dummyThreadHackAddr); } @@ -660,7 +662,9 @@ void __NetAdhocDoState(PointerWrap &p) { } if (s >= 3) { Do(p, actionAfterAdhocMipsCall); - __KernelRestoreActionType(actionAfterAdhocMipsCall, AfterAdhocMipsCall::Create); + if (actionAfterAdhocMipsCall != -1) { + __KernelRestoreActionType(actionAfterAdhocMipsCall, AfterAdhocMipsCall::Create); + } Do(p, matchingThreadHackAddr); }