From 1f67fe29599ed8d8745118618f9b3b18df6d9f81 Mon Sep 17 00:00:00 2001 From: Alezito2008 Date: Tue, 3 Mar 2026 17:27:34 -0300 Subject: [PATCH] Fix: player movement and input leaks when UI is active --- Minecraft.Client/Common/UI/UIController.cpp | 7 ++++++- Minecraft.Client/LocalPlayer.cpp | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 9e4a32024..e74f8d195 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -1606,7 +1606,7 @@ bool UIController::NavigateBack(int iPad, bool forceUsePad, EUIScene eScene, EUI bool navComplete = false; if( app.GetGameStarted() ) { - bool navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer); + navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer); if(!navComplete && ( iPad != 255 ) && ( iPad >= 0 ) ) { @@ -1632,6 +1632,11 @@ bool UIController::NavigateBack(int iPad, bool forceUsePad, EUIScene eScene, EUI navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer); if(!m_groups[(int)eUIGroup_Fullscreen]->GetMenuDisplayed()) SetMenuDisplayed(XUSER_INDEX_ANY,false); } + + if (navComplete) { + KMInput.ConsumeMousePress(0); + } + return navComplete; } diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index bb25105f7..2c1935314 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -379,7 +379,7 @@ void LocalPlayer::aiStep() { // yd = 0; // 4J - note that the 0.42 added for going down is to make it match with what happens when you jump - jumping itself adds 0.42 to yd in Mob::jumpFromGround - if (ullButtonsPressed & (1LL<jumping) { noJumpDelay = 0; @@ -1519,7 +1519,7 @@ bool LocalPlayer::handleMouseClick(int button) { bool returnItemPlaced = false; - if (button == 0 && missTime > 0) return false; + if (button == 0 && missTime > 0) return false; if (button == 0) { //app.DebugPrintf("handleMouseClick - Player %d is swinging\n",GetXboxPad());