Fix bikes breaking when their steering lock is set to zero - #5152
Open
TheCrazy17 wants to merge 2 commits into
Open
Fix bikes breaking when their steering lock is set to zero#5152TheCrazy17 wants to merge 2 commits into
TheCrazy17 wants to merge 2 commits into
Conversation
Member
|
Please resolve conflicts & fix build |
Contributor
Author
Done ✅ |
FileEX
approved these changes
Aug 15, 2026
FileEX
reviewed
Aug 15, 2026
| // clang-format off | ||
| __asm | ||
| { | ||
| push eax |
Member
There was a problem hiding this comment.
It looks like you don't need to preserve this register, since it's modified at 0x6BAC22 anyway
FileEX
reviewed
Aug 15, 2026
| // clang-format off | ||
| __asm | ||
| { | ||
| push eax |
Member
There was a problem hiding this comment.
It looks like you don't need to preserve this register, since it's modified at 0x6BBAE2.
FileEX
requested changes
Aug 15, 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.
Summary
Sets the bike steer and lean ratios to zero when a vehicle's
steeringLockhandling is zero, instead of dividing by it.Motivation
Resolves #494.
CBike::ProcessControldivides the steer angle by the steering lock in radians to get a ratio. The steer angle is itself the steering lock times the input, so a lock of zero makes this 0 / 0, a NaN rather than an infinity. Cars survive the same division because an infinity trips their "greater than 1" clamp, while a NaN compares false against every clamp and passes straight through. It reaches the rider lean angle, andCBike::CalculateLeanMatrixbuilds the bike and rider matrices from it, stretching the ped until respawn.Test plan
Repro from the issue:
Get an NRG-500, set its steeringLock to 0, and crash into something. Before this change the ped stretches out and stays broken until respawn. After it, the bike behaves like a normal collision.
Also checked that bikes with a normal steering lock still steer and lean correctly, since only the zero case takes the new path.
Checklist