Merge branch '4jcraft:dev' into issue/51-phase-1-portable-win32-cleanup

This commit is contained in:
MatthewBeshay
2026-03-11 18:27:03 +11:00
committed by GitHub
5 changed files with 18 additions and 12 deletions

View File

@@ -305,7 +305,7 @@ void LocalPlayer::aiStep()
// 4J - altered this slightly to make sure that the joypad returns to below returnTreshold in between registering two movements up to runThreshold
if (onGround && !isSprinting() && enoughFoodToSprint && !isUsingItem() && !hasEffect(MobEffect::blindness))
{
if( !wasRunning && input->ya >= runTreshold )
if( !wasRunning && (input->ya >= runTreshold) )
{
if (sprintTriggerTime == 0)
{
@@ -326,14 +326,18 @@ void LocalPlayer::aiStep()
{
sprintTriggerRegisteredReturn = true;
}
else if (input->sprintKey)
{
setSprinting(true);
}
}
if (isSneaking()) sprintTriggerTime = 0;
// 4J-PB - try not stopping sprint on collision
//if (isSprinting() && (input->ya < runTreshold || horizontalCollision || !enoughFoodToSprint))
if (isSprinting() && (input->ya < runTreshold || !enoughFoodToSprint))
if (isSprinting() && ((input->ya < runTreshold && !input->sprintKey) || !enoughFoodToSprint))
{
setSprinting(false);
}
}
// 4J Stu - Fix for #52705 - Customer Encountered: Player can fly in bed while being in Creative mode.
if (!isSleeping() && (abilities.mayfly || isAllowedToFly() ))