mirror of
https://github.com/wiiu-env/FunctionPatcherModule.git
synced 2026-05-07 21:37:16 -05:00
Make sure to re-patch function when restoring nested function patches
This commit is contained in:
parent
8a8725e6f9
commit
789fc1134a
|
|
@ -95,7 +95,8 @@ FunctionPatcherStatus FPRemoveFunctionPatch(PatchedFunctionHandle handle) {
|
||||||
return FUNCTION_PATCHER_RESULT_PATCH_NOT_FOUND;
|
return FUNCTION_PATCHER_RESULT_PATCH_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toBeRemoved->isPatched) {
|
bool functionWasPatched = toBeRemoved->isPatched;
|
||||||
|
if (functionWasPatched) {
|
||||||
// Restore function patches that were done after the patch we actually want to restore.
|
// Restore function patches that were done after the patch we actually want to restore.
|
||||||
for (auto &cur : std::ranges::reverse_view(toBeTempRestored)) {
|
for (auto &cur : std::ranges::reverse_view(toBeTempRestored)) {
|
||||||
RestoreFunction(cur);
|
RestoreFunction(cur);
|
||||||
|
|
@ -107,7 +108,7 @@ FunctionPatcherStatus FPRemoveFunctionPatch(PatchedFunctionHandle handle) {
|
||||||
|
|
||||||
gPatchedFunctions.erase(gPatchedFunctions.begin() + erasePosition);
|
gPatchedFunctions.erase(gPatchedFunctions.begin() + erasePosition);
|
||||||
|
|
||||||
if (toBeRemoved->isPatched) {
|
if (functionWasPatched) {
|
||||||
// Apply the other patches again
|
// Apply the other patches again
|
||||||
for (auto &cur : toBeTempRestored) {
|
for (auto &cur : toBeTempRestored) {
|
||||||
PatchFunction(cur);
|
PatchFunction(cur);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user