Skip to content

Commit

Permalink
Workaround for multi-stage patching crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
DankRank committed Apr 2, 2019
1 parent 3564090 commit 33bb598
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion thcrap/src/init.cpp
Expand Up @@ -410,7 +410,10 @@ int thcrap_init_binary(size_t stage_num, HMODULE *hModPtr)
auto hMod = hModPtr ? *hModPtr : hModFromStage;

ret += binhacks_apply(binhacks, hMod);
ret += breakpoints_apply(&bp_set[stage_num], breakpoints, hMod);
// FIXME: this workaround is needed, because breakpoints don't check what they overwrite
if (!(ret != 0 && stage_num == 0 && stages_total >= 2)){
ret += breakpoints_apply(&bp_set[stage_num], breakpoints, hMod);
}

if(stages_total >= 2) {
if(ret != 0 && stage_num == 0 && stages_total >= 2) {
Expand Down

0 comments on commit 33bb598

Please sign in to comment.