From 75b512764be227041f507be73ebf5b0e2938c01d Mon Sep 17 00:00:00 2001 From: Silent Date: Wed, 10 Jan 2018 01:08:41 +0100 Subject: [PATCH] Updated RsMouseSetPos call fix --- SilentPatchIII/SilentPatchIII.cpp | 7 +++++-- SilentPatchVC/SilentPatchVC.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/SilentPatchIII/SilentPatchIII.cpp b/SilentPatchIII/SilentPatchIII.cpp index bad799a..adc61dd 100644 --- a/SilentPatchIII/SilentPatchIII.cpp +++ b/SilentPatchIII/SilentPatchIII.cpp @@ -133,8 +133,8 @@ LRESULT CALLBACK CustomWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara } static auto* const pCustomWndProc = CustomWndProc; -static void (* const ConstructRenderList)() = AddressByVersion(0x4A76B0, 0x4A77A0, 0x4A7730); static void (* const RsMouseSetPos)(RwV2d*) = AddressByVersion(0x580D20, 0x581070, 0x580F70); +static void (*orgConstructRenderList)(); void ResetMousePos() { if ( bGameInFocus ) @@ -142,7 +142,7 @@ void ResetMousePos() RwV2d vecPos = { RsGlobal->MaximumWidth * 0.5f, RsGlobal->MaximumHeight * 0.5f }; RsMouseSetPos(&vecPos); } - ConstructRenderList(); + orgConstructRenderList(); } void __declspec(naked) M16StatsFix() @@ -434,6 +434,7 @@ void Patch_III_10(const RECT& desktop) InjectHook(0x57E9F5, AlteredPrintString<0x57E9EE,0x57E9CD>); // RsMouseSetPos call (SA style fix) + ReadCall( 0x48E539, orgConstructRenderList ); InjectHook(0x48E539, ResetMousePos); // New wndproc @@ -580,6 +581,7 @@ void Patch_III_11(const RECT& desktop) InjectHook(0x57ED45, AlteredPrintString<0x57ED3E,0x57ED1D>); // RsMouseSetPos call (SA style fix) + ReadCall( 0x48E5F9, orgConstructRenderList ); InjectHook(0x48E5F9, ResetMousePos); // New wndproc @@ -702,6 +704,7 @@ void Patch_III_Steam(const RECT& desktop) InjectHook(0x57EC45, AlteredPrintString<0x57EC3E,0x57EC1D>); // RsMouseSetPos call (SA style fix) + ReadCall( 0x48E589, orgConstructRenderList ); InjectHook(0x48E589, ResetMousePos); // New wndproc diff --git a/SilentPatchVC/SilentPatchVC.cpp b/SilentPatchVC/SilentPatchVC.cpp index 497aa9a..14b1a42 100644 --- a/SilentPatchVC/SilentPatchVC.cpp +++ b/SilentPatchVC/SilentPatchVC.cpp @@ -77,8 +77,8 @@ LRESULT CALLBACK CustomWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara } static auto* const pCustomWndProc = CustomWndProc; -static void (* const ConstructRenderList)() = AddressByVersion(0x4CA260, 0x4CA280, 0x4CA120); static void (* const RsMouseSetPos)(RwV2d*) = AddressByVersion(0x6030C0, 0x6030A0, 0x602CE0); +static void (*orgConstructRenderList)(); void ResetMousePos() { if ( bGameInFocus ) @@ -86,7 +86,7 @@ void ResetMousePos() RwV2d vecPos = { RsGlobal->MaximumWidth * 0.5f, RsGlobal->MaximumHeight * 0.5f }; RsMouseSetPos(&vecPos); } - ConstructRenderList(); + orgConstructRenderList(); } void __stdcall Recalculate(float& fX, float& fY, signed int nShadow) @@ -265,6 +265,7 @@ void Patch_VC_10(const RECT& desktop) // RsMouseSetPos call (SA style fix) + ReadCall( 0x4A5E45, orgConstructRenderList ); InjectHook(0x4A5E45, ResetMousePos); // New wndproc @@ -378,6 +379,7 @@ void Patch_VC_11(const RECT& desktop) InjectHook(0x600469, GetTimeSinceLastFrame); // RsMouseSetPos call (SA style fix) + ReadCall( 0x4A5E65, orgConstructRenderList ); InjectHook(0x4A5E65, ResetMousePos); // New wndproc @@ -482,6 +484,7 @@ void Patch_VC_Steam(const RECT& desktop) InjectHook(0x6000A9, GetTimeSinceLastFrame); // RsMouseSetPos call (SA style fix) + ReadCall( 0x4A5D15, orgConstructRenderList ); InjectHook(0x4A5D15, ResetMousePos); // New wndproc