-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
typified a bit of vehicle.h and dependents #77554
Conversation
Hidden among hundreds of copies of the same demands for obfuscation addressed by an update, there was a demand I was unable to parse:
should have "const" added apparently between "vehicle::" and "get_parts_at". This function is identical to the old untyped function directly above, save for the "pos" parameter being typed. |
Summary
None
Purpose of change
Another step on the path to use typed coordinates, this time focusing on vehicle.h and dependents.
Describe the solution
Continue from where the previous PR left off to:
Change untyped coordinate fields and operation parameter/results into appropriate typed ones, converting reasonably easy usages and removing orphaned untyped operations.
There should be no functional changes.
Also split a "point" parameter used to hide turn direction + acceleration into its parts in a couple of operations so it's actually possible to understand what the parameters are. It can be noted that one of the users of this seems to use the same practice, but dealing with that was considered out of scope.
Describe alternatives you've considered
Testing
Loaded a save, walked up a ramp, jumped into a car, drove through some hay bales (which are no longer reinforced), missed zombie corpses, but ran over a turkey and smashed into a stationary vehicle. Nothing odd seen.
Additional context
There was one untyped element of vehicle that was used to store both absolute coordinates (for item use) and bubble coordinates (for turret use). I settled on absolute coordinates, as that's the one that won't break with a change of bubble references, and converted the bubble usage to convert to/from absolute. Presumably the two usages don't overlap, but I wouldn't bet on what happens if a cannon engages while your doing whatever the item stuff does.
It's not that much left of the vehicle header after this pass. The next one will probably deal with that and start with the implementation. Vehicle parts have a bunch of annoying untyped fields blocking some conversion, so that's probably the next target after the vehicle implementation has been dealt with, but it's unlikely that will being in the next PR.
Given that this touches a lot of files, there's definitely a merge conflict risk merging this PR concurrently with others, so that should probably be avoided.