Fix Ctrl-sprint not working while flying in creative mode (#563)

Remove the !player->abilities.flying guard that was incorrectly added around the Ctrl-sprint block in Input.cpp during the KBM refactor. This prevented Ctrl+W from initiating sprint while flying in creative mode. Sprinting on the ground in both survival and creative worked fine.

The sprint flag now sets correctly whenever Ctrl+W is held, including while flying. LocalPlayer::aiStep() still properly gates setSprinting() with onGround, enoughFoodToSprint, isUsingItem etc.

Fixes smartcmd/MinecraftConsoles#470
This commit is contained in:
Marlian
2026-03-05 14:39:11 +01:00
committed by GitHub
parent a37ebe221c
commit 9c17f3473a

View File

@@ -104,8 +104,7 @@ void Input::tick(LocalPlayer *player)
} }
} }
// Ctrl + forward = sprint (hold to sprint) // Ctrl + forward = sprint (hold to sprint, including while flying)
if (!player->abilities.flying)
{ {
bool ctrlHeld = g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_SPRINT); bool ctrlHeld = g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_SPRINT);
bool movingForward = (kbYA > 0.0f); bool movingForward = (kbYA > 0.0f);
@@ -119,10 +118,6 @@ void Input::tick(LocalPlayer *player)
sprinting = false; sprinting = false;
} }
} }
else
{
sprinting = false;
}
} }
else if (iPad == 0) else if (iPad == 0)
{ {