From da8ae8b4d1085dafef41ab039e35bd6589da53b6 Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Wed, 20 Nov 2024 04:57:03 +0000 Subject: [PATCH] api: fix score offset --- UnleashedRecomp/api/SWA/System/GameDocument.h | 2 +- UnleashedRecomp/patches/player_patches.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/UnleashedRecomp/api/SWA/System/GameDocument.h b/UnleashedRecomp/api/SWA/System/GameDocument.h index b75db5e9..cd563e70 100644 --- a/UnleashedRecomp/api/SWA/System/GameDocument.h +++ b/UnleashedRecomp/api/SWA/System/GameDocument.h @@ -17,7 +17,7 @@ namespace SWA boost::shared_ptr m_spDatabase; SWA_INSERT_PADDING(0x8C); xpointer m_pSoundAdministrator; - SWA_INSERT_PADDING(0x15C); + SWA_INSERT_PADDING(0x158); be m_Score; }; diff --git a/UnleashedRecomp/patches/player_patches.cpp b/UnleashedRecomp/patches/player_patches.cpp index 6b42a81a..7c901615 100644 --- a/UnleashedRecomp/patches/player_patches.cpp +++ b/UnleashedRecomp/patches/player_patches.cpp @@ -24,6 +24,8 @@ PPC_FUNC(sub_82624308) return; m_lastCheckpointScore = pGameDocument->m_pMember->m_Score; + + printf("[*] Score: %d\n", m_lastCheckpointScore); } /* Hook function that resets the score @@ -41,7 +43,7 @@ PPC_FUNC(sub_8245F048) if (!pGameDocument) return; - printf("[*] Resetting score to %d\n", m_lastCheckpointScore); + printf("[*] Score: %d\n", m_lastCheckpointScore); pGameDocument->m_pMember->m_Score = m_lastCheckpointScore; }