From edbe62e4219bd09a9a6a35faed99932de03aefcb Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 28 Apr 2018 16:44:36 +0200 Subject: [PATCH] Tie credits XOR to revision version so it changes every public build Corrected credits hook (in case somebody else hooks there already...) --- SilentPatchSA/SilentPatchSA.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index faca86e..a3dcaf5 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -1353,6 +1353,7 @@ static CVehicle* FindPlayerVehicle_RCWrap( int playerID, bool ) namespace Credits { static void (*PrintCreditText)(float scaleX, float scaleY, const char* text, unsigned int& pos, float timeOffset, bool isHeader); + static void (*PrintCreditText_Hooked)(float scaleX, float scaleY, const char* text, unsigned int& pos, float timeOffset, bool isHeader); static void PrintCreditSpace( float scale, unsigned int& pos ) { @@ -1361,7 +1362,7 @@ namespace Credits constexpr char xvChar(const char ch) { - constexpr uint8_t xv = 0x27; + constexpr uint8_t xv = SILENTPATCH_REVISION_ID; return ch ^ xv; } @@ -1373,7 +1374,7 @@ namespace Credits static void PrintSPCredits( float scaleX, float scaleY, const char* text, unsigned int& pos, float timeOffset, bool isHeader ) { // Original text we intercepted - PrintCreditText( scaleX, scaleY, text, pos, timeOffset, isHeader ); + PrintCreditText_Hooked( scaleX, scaleY, text, pos, timeOffset, isHeader ); PrintCreditSpace( 1.5f, pos ); { @@ -3557,6 +3558,7 @@ void Patch_SA_10() // Credits =) ReadCall( 0x5AF87A, Credits::PrintCreditText ); + ReadCall( 0x5AF8A4, Credits::PrintCreditText_Hooked ); InjectHook( 0x5AF8A4, Credits::PrintSPCredits );