bugfix: Holding CTRL key resets flying acceleration#863
Merged
rtm516 merged 1 commit intosmartcmd:mainfrom Mar 7, 2026
Merged
Conversation
rtm516
approved these changes
Mar 7, 2026
retroohmygod
pushed a commit
to retroohmygod/astrasmcfork
that referenced
this pull request
Mar 8, 2026
piebotc
pushed a commit
to piebotc/LegacyEvolved
that referenced
this pull request
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When flying in creative mode, attempting to hold down the CTRL key causes the player to fly slower rather than faster (like with double tapping W). This PR fixes that bug such that pressing CTRL will also make the player fly as fast as double tapping W
Changes
Previous Behavior
Holding CTRL slows the player down when flying.
Root Cause
The flying velocity ramp-up behavior is scaled using the following formula:
MinecraftConsoles/Minecraft.Client/LocalPlayer.cpp
Line 444 in bbe396d
SPRINT_DURATIONis a constant that is always 600. When holding CTRL,sprintTimealways gets reset to 600. Therefore,scale = 0which makes the player slow. Using a combination of tracepoints, I determined thatsetSprinting(true)setssprintTime = SPRINT_DURATION, which means that while pressing CTRL one time will start the countdown here:MinecraftConsoles/Minecraft.Client/LocalPlayer.cpp
Line 169 in bbe396d
scalewill never go above zero. I have determined that this line:MinecraftConsoles/Minecraft.Client/LocalPlayer.cpp
Line 281 in bbe396d
New Behavior
Holding CTRL now speeds the player up to full velocity when flying.
Fix Implementation
Added a check to make sure that
setSprinting(true)was not called if the player is already "sprinting" when flying.setSprinting()causes the acceleration to start from zero. Therefore, if you hold down CTRLsetSprinting(true)will be called repeatedly thus always slowing down the player when flying.AI Use Disclosure
AI was only used to understand the quadratic acceleration code:
Related Issues