diff --git a/source-code/source/plugins/TLAC/Components/ScoreSaver.cpp b/source-code/source/plugins/TLAC/Components/ScoreSaver.cpp index b99ee5b..ad2df68 100644 --- a/source-code/source/plugins/TLAC/Components/ScoreSaver.cpp +++ b/source-code/source/plugins/TLAC/Components/ScoreSaver.cpp @@ -28,7 +28,7 @@ namespace TLAC::Components char ScoreSaver::selHighScore[12] = "--------(-)"; char ScoreSaver::selHighPct1[4] = "---"; char ScoreSaver::selHighPct2[3] = "--"; - void(__stdcall* ScoreSaver::divaInitResults)(void* cls) = (void(__stdcall*)(void* cls))RESULTS_INIT_ADDRESS; + bool(__stdcall* ScoreSaver::divaInitResults)(void* cls) = (bool(__stdcall*)(void* cls))RESULTS_INIT_ADDRESS; void ScoreSaver::Initialize(ComponentsManager*) { // replace code that loads personal high scores on pv select screen with code that loads custom strings @@ -146,15 +146,15 @@ namespace TLAC::Components return expectedCheck == (int)(((short)score ^ ((short)cntHitTypes[0] << 16) ^ ((short)cntHitTypes[1]) ^ ((short)percent << 16) ^ ((short)combo)) * clearRank + (allTimeRank * clearRank)); } - void ScoreSaver::hookedInitResults(void* cls) + bool ScoreSaver::hookedInitResults(void* cls) { - divaInitResults(cls); + bool result = divaInitResults(cls); int clearRank = *(int*)(RESULTS_BASE_ADDRESS + 0xe8); int insurance = *(int*)(GAME_INFO_ADDRESS + 0x14); if (clearRank < 2 || insurance !=0) - return; + return result; // get the base for this specific set of results uint64_t resultBase = *(uint64_t*)(RESULTS_BASE_ADDRESS + 0x100); @@ -276,6 +276,8 @@ namespace TLAC::Components swprintf(val, 32, L"%d", oldCheck - (oldAlltimeRank * oldClearRank) + (allTimeRank * oldClearRank)); WritePrivateProfileStringW(section, key, val, configPath); } + + return result; } void ScoreSaver::Update() diff --git a/source-code/source/plugins/TLAC/Components/ScoreSaver.h b/source-code/source/plugins/TLAC/Components/ScoreSaver.h index c23b539..7a006d8 100644 --- a/source-code/source/plugins/TLAC/Components/ScoreSaver.h +++ b/source-code/source/plugins/TLAC/Components/ScoreSaver.h @@ -19,8 +19,8 @@ namespace TLAC::Components virtual void UpdateInput() override; private: - static void(__stdcall* divaInitResults)(void* cls); - static void hookedInitResults(void* cls); + static bool(__stdcall* divaInitResults)(void* cls); + static bool hookedInitResults(void* cls); static void InjectCode(void* address, const std::vector data); static bool checkExistingScoreValid(int pv, int difficulty, int isEx);