fix: use modern KBM handling for input and localplayer

This commit is contained in:
2026-08-26 19:22:44 -05:00
parent 802b0ebfdf
commit 405b054ff5
2 changed files with 17 additions and 15 deletions
+9 -6
View File
@@ -33,17 +33,16 @@ void Input::tick(LocalPlayer *player)
Minecraft *pMinecraft=Minecraft::GetInstance();
int iPad=player->GetXboxPad();
float conXA, conYA = 0.0f;
// 4J-PB minecraft movement seems to be the wrong way round, so invert x!
if( pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_LEFT) || pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_RIGHT) )
xa = -InputManager.GetJoypadStick_LX(iPad);
else
xa = 0.0f;
conXA = -InputManager.GetJoypadStick_LX(iPad);
if( pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_FORWARD) || pMinecraft->localgameModes[iPad]->isInputAllowed(MINECRAFT_ACTION_BACKWARD) )
ya = InputManager.GetJoypadStick_LY(iPad);
else
ya = 0.0f;
conYA = InputManager.GetJoypadStick_LY(iPad);
float kbXA, kbYA = 0.0f;
#ifdef _WINDOWS64
if (iPad == 0 && g_KBMInput.IsMouseGrabbed() && g_KBMInput.IsKBMActive())
@@ -54,6 +53,10 @@ void Input::tick(LocalPlayer *player)
kbYA = g_KBMInput.GetMoveY();
}
#endif
xa = kbXA != 0.0f ? kbXA : conXA;
ya = kbYA != 0.0f ? kbYA : conYA;
#ifndef _CONTENT_PACKAGE
if (app.GetFreezePlayers())
{