Fix: player movement and input leaks when UI is active

This commit is contained in:
Alezito2008 2026-03-03 17:27:34 -03:00
parent 31cc598b75
commit 1f67fe2959
2 changed files with 8 additions and 3 deletions

View file

@ -1606,7 +1606,7 @@ bool UIController::NavigateBack(int iPad, bool forceUsePad, EUIScene eScene, EUI
bool navComplete = false; bool navComplete = false;
if( app.GetGameStarted() ) 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 ) ) 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); navComplete = m_groups[(int)eUIGroup_Fullscreen]->NavigateBack(iPad, eScene, eLayer);
if(!m_groups[(int)eUIGroup_Fullscreen]->GetMenuDisplayed()) SetMenuDisplayed(XUSER_INDEX_ANY,false); if(!m_groups[(int)eUIGroup_Fullscreen]->GetMenuDisplayed()) SetMenuDisplayed(XUSER_INDEX_ANY,false);
} }
if (navComplete) {
KMInput.ConsumeMousePress(0);
}
return navComplete; return navComplete;
} }

View file

@ -379,7 +379,7 @@ void LocalPlayer::aiStep()
{ {
// yd = 0; // 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 // 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<<MINECRAFT_ACTION_SNEAK_TOGGLE) ) yd -= ( 0.15 + 0.42 ); // 4J - for flying mode, MINECRAFT_ACTION_SNEAK_TOGGLE isn't a toggle but just indicates that this button is down if (ullButtonsPressed & (1LL<<MINECRAFT_ACTION_SNEAK_TOGGLE) && !ui.GetMenuDisplayed(m_iPad)) yd -= ( 0.15 + 0.42 ); // 4J - for flying mode, MINECRAFT_ACTION_SNEAK_TOGGLE isn't a toggle but just indicates that this button is down
if (input->jumping) if (input->jumping)
{ {
noJumpDelay = 0; noJumpDelay = 0;
@ -1519,7 +1519,7 @@ bool LocalPlayer::handleMouseClick(int button)
{ {
bool returnItemPlaced = false; bool returnItemPlaced = false;
if (button == 0 && missTime > 0) return false; if (button == 0 && missTime > 0) return false;
if (button == 0) if (button == 0)
{ {
//app.DebugPrintf("handleMouseClick - Player %d is swinging\n",GetXboxPad()); //app.DebugPrintf("handleMouseClick - Player %d is swinging\n",GetXboxPad());