From 18a917378a1e2a39f3e637e31cc981483d18674b Mon Sep 17 00:00:00 2001 From: Boomslangnz Date: Fri, 7 Apr 2023 10:43:30 +1200 Subject: [PATCH] fix GRID real ffb black screen issue --- Game Files/GRIDReal.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Game Files/GRIDReal.cpp b/Game Files/GRIDReal.cpp index fb5d34a..76e00c6 100644 --- a/Game Files/GRIDReal.cpp +++ b/Game Files/GRIDReal.cpp @@ -31,6 +31,9 @@ static int FFBCounter; static int(__stdcall* Out32Ori)(DWORD device, DWORD data); static int __stdcall Out32Hook(DWORD device, DWORD data) { + if (FFBOrRumble) + return 0; + if (device == 0x1020) { ++FFBCounter; @@ -56,7 +59,7 @@ static int __stdcall Out32Hook(DWORD device, DWORD data) } } - return Out32Ori(device, data); + return 0; } static int(__fastcall* EnableFFBOri)(int a1, double a2); @@ -88,9 +91,8 @@ void GRIDReal::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigg MH_Initialize(); MH_CreateHook((void*)(ImageBase + 0x79CDE0), EnableFFBHook, (void**)&EnableFFBOri); - if (!FFBOrRumble) - MH_CreateHookApi(L"inpout32.dll", "Out32", Out32Hook, (void**)&Out32Ori); - else + MH_CreateHookApi(L"inpout32.dll", "Out32", Out32Hook, (void**)&Out32Ori); + if (FFBOrRumble) MH_CreateHookApi(L"xinput1_3.dll", "XInputSetState", &XInputSetStateGRID, NULL); MH_EnableHook(MH_ALL_HOOKS); }