diff --git a/source-code/source/plugins/TLAC/Components/Pause.cpp b/source-code/source/plugins/TLAC/Components/Pause.cpp index f3ff749..a62489c 100644 --- a/source-code/source/plugins/TLAC/Components/Pause.cpp +++ b/source-code/source/plugins/TLAC/Components/Pause.cpp @@ -657,20 +657,13 @@ namespace TLAC::Components bool Pause::hookedGiveUpFunc(void* cls) { - if (giveUp) + if (giveUp || divaGiveUpFunc(cls)) { giveUp = false; pause = false; return true; } - else - { - if (divaGiveUpFunc(cls)) - { - pause = false; - return true; - } - } + return false; } @@ -690,19 +683,22 @@ namespace TLAC::Components char Pause::hookedScriptCommandFunc(uint64_t p1, uint64_t p2, uint64_t p3, void* p4, void* p5, char p6, char p7) { - int position = *(int*)(p1 + 180012); - int cmd = *(int*)(p1 + 4 * position + 12); + if (autoReplay) + { + int position = *(int*)(p1 + 180012); + int cmd = *(int*)(p1 + 4 * position + 12); - // printf("ARG: %lld, %lld, %lld, %p, %p, %d, %d - POS: %d, CMD: %d\n", p1, p2, p3, p4, p5, p6, p7, position, cmd); + // printf("ARG: %lld, %lld, %lld, %p, %p, %d, %d - POS: %d, CMD: %d\n", p1, p2, p3, p4, p5, p6, p7, position, cmd); - if (cmd == 83 && autoReplay) - { - printf("[TLAC] END_FADEOUT triggered but ignored\n"); + if (cmd == 83) + { + printf("[TLAC] END_FADEOUT triggered but ignored\n"); - // fix stucking at restart and the PV Script Command Error - *(int*)(p1 + 180012) = position + 3; + // fix stucking at restart and the PV Script Command Error + *(int*)(p1 + 180012) = position + 3; - return 1; + return 1; + } } return divaScriptCommandFunc(p1, p2, p3, p4, p5, p6, p7); diff --git a/source-code/source/plugins/TLAC/Components/Pause.h b/source-code/source/plugins/TLAC/Components/Pause.h index 3578c2b..192f86c 100644 --- a/source-code/source/plugins/TLAC/Components/Pause.h +++ b/source-code/source/plugins/TLAC/Components/Pause.h @@ -75,7 +75,7 @@ namespace TLAC::Components static const int menuX = 640; static const int menuY = 360; - static const int menuItemWidth = 150; + static const int menuItemWidth = 180; static const int menuItemHeight = 36; static const int menuItemPadding = 12; static const int menuItemTotalHeight = menuItemHeight + menuItemPadding; @@ -246,6 +246,15 @@ namespace TLAC::Components *(uint8_t*)0x140D0A50C = 0; // not clear flag *(char*)0x140D0AA0F = 0; // chance time + // reset give up/end flags + // because the code above doesn't reset them + // and causing you to complete with MISSxTAKE + // if you restarted after give up triggered + *(char*)0x140D0AA09 = 0; + *(char*)0x140D0AA0E = 0; + *(char*)0x140D0AA20 = 0; + *(char*)0x140D0AA35 = 0; + // revert patches and unpause InjectCode((void*)0x1401038cd, { 0x12 }); InjectCode((void*)0x140103b94, { 0x16 }); unpause();