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