From 1049081cdd5ee2f18a61f37125e75258c0abdeb5 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Sun, 1 Aug 2021 00:29:50 +0600 Subject: [PATCH] Fix issue with sniper zoom --- src/Hook.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Hook.cpp b/src/Hook.cpp index e5eddae..c82a004 100644 --- a/src/Hook.cpp +++ b/src/Hook.cpp @@ -7,17 +7,6 @@ LRESULT Hook::WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam); - if (m_bShowMouse) - { - patch::Nop(0x4EB9F4, 5); // disable radio scroll - CPad::ClearMouseHistory(); - - if (uMsg == WM_MOUSEWHEEL) - return 1; - } - else - patch::SetRaw(0x4EB9F4, (void*)"\xE8\x67\xFC\xFF\xFF", 5); // enable radio scroll - if (ImGui::GetIO().WantTextInput) { Call<0x53F1E0>(); // CPad::ClearKeyboardHistory @@ -237,7 +226,7 @@ static LRESULT __stdcall _DispatchMessage(MSG* lpMsg) { if (lpMsg->message == WM_MOUSEWHEEL && !Hook::m_bShowMouse) { - mouseInfo.wheelDelta += *(int*)(&lpMsg->wParam); + mouseInfo.wheelDelta += GET_WHEEL_DELTA_WPARAM(lpMsg->wParam); } return DispatchMessageA(lpMsg); @@ -246,7 +235,9 @@ static LRESULT __stdcall _DispatchMessage(MSG* lpMsg) static int _cdecl _GetMouseState(Mouse* pMouse) { if (Hook::m_bShowMouse) + { return -1; + } struct tagPOINT Point;