From 630944460fdadf9dc9a1f2f6be346a7176af62ae Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Sat, 23 Jan 2021 04:30:43 +0600 Subject: [PATCH] Fix camera lock issue --- src/Hook.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Hook.cpp b/src/Hook.cpp index 5b40958..6f9c49c 100644 --- a/src/Hook.cpp +++ b/src/Hook.cpp @@ -151,17 +151,21 @@ void Hook::ShowMouse(bool state) patch::SetRaw(0x53F41F, (void*)"\x85\xC0\x0F\x8C", 4); // xor eax, eax -> test eax, eax , enable camera mouse movement // jz loc_53F526 -> jl loc_53F526 patch::SetUChar(0x6194A0, 0xE9); // jmp setup - mouse_visibility = show_mouse; } } - ImGui::GetIO().MouseDrawCursor = state; - CPad::NewMouseControllerState.X = 0; - CPad::NewMouseControllerState.Y = 0; + if (mouse_visibility != show_mouse) + { + CPad::NewMouseControllerState.X = 0; + CPad::NewMouseControllerState.Y = 0; - // Broken in psdk - Call<0x541BD0>(); // CPad::ClearMouseHistory - Call<0x541DD0>(); // CPad::UpdatePads + // Broken in psdk + Call<0x541BD0>(); // CPad::ClearMouseHistory + Call<0x541DD0>(); // CPad::UpdatePads + + ImGui::GetIO().MouseDrawCursor = state; + mouse_visibility = show_mouse; + } } Hook::Hook()