Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unfolded vehicles not driveable before stepping off/on #59429

Merged
merged 3 commits into from
Jul 22, 2022

Conversation

irwiss
Copy link
Contributor

@irwiss irwiss commented Jul 20, 2022

Summary

Bugfixes "Fix unfolded vehicles not driveable before stepping off/on the tile"

Purpose of change

Fixes #54026

Describe the solution

Both unfolds (the new generic vehicle and the old convertible one) were skipping over map::board_vehicle so player's in_vehicle = false prevented driving when pressing ^ before stepping out of/into the controls tile.

Also one was missing adding vehicle to cache and the other had a weird nullcheck after already dereferencing so I rearranged the calls a bit to make them cohesive and more or less the same.

Had to go on a hunt into tests why it was complaining about unboarding; vehicle hp with degradation tests read a bit weird, can't see where they clean up the created vehicles, may be I missed it somewhere, but unboarding at end of check is enough to pass tests.

Also changed debugmsg when boarding to make it clear what was missing ( in one case it was a non-broken boardable part )

Describe alternatives you've considered

Testing

Spawn folding bicycle, unfold, press ^ - just the controls screen pops up (this is the convertible unfold)
Spawn wheelchair do the same (this is using generic unfold)
Apply patch
Do the above again and you should be able to drive immediately after unfolding

Additional context

@github-actions github-actions bot added the [C++] Changes (can be) made in C++. Previously named `Code` label Jul 20, 2022
@irwiss irwiss changed the title Fix unfolded vehicles not drivable before stepping off/on Fix unfolded vehicles not driveable before stepping off/on Jul 20, 2022
@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Jul 20, 2022
@irwiss irwiss force-pushed the fix-folded-vehicles-boarding branch from 3fedcd6 to e1fc66e Compare July 20, 2022 03:22
@github-actions github-actions bot added the Code: Tests Measurement, self-control, statistics, balancing. label Jul 20, 2022
@irwiss irwiss force-pushed the fix-folded-vehicles-boarding branch from e1fc66e to 2a0e74b Compare July 20, 2022 03:36
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 20, 2022
@irwiss irwiss marked this pull request as ready for review July 20, 2022 04:18
@dseguin dseguin merged commit a4008fc into CleverRaven:master Jul 22, 2022
@irwiss irwiss deleted the fix-folded-vehicles-boarding branch July 22, 2022 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

You cannot start driving an unfolded vehicle without stepping off, then stepping back on
2 participants