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

typified vehicle stuff #77764

Merged
merged 7 commits into from
Nov 22, 2024
Merged

typified vehicle stuff #77764

merged 7 commits into from
Nov 22, 2024

Conversation

PatrikLundell
Copy link
Contributor

Summary

None

Purpose of change

Replace untyped coordinate usage with typed usage.

Describe the solution

Go through the remainder of vehicle.h, sweep over vehicle.cpp, and go through the rest of the vehicle related .h files to update operation, duplicate ones that still depend on untyped usage, and replace unused untyped operation. This process involves some modification to usages.

Describe alternatives you've considered

Try to fix this section of vehicle.cpp:

            // TODO: Check if this is correct. part_at takes a vehicle relative position, not a bub one...
            int part_idx = part_at( p.xy().raw() );

but decided to leave it as a turd for later clean up. Didn't find any operation that actually took bubble coordinates, so fixing this would require subtracting the vehicle coordinates from the bubble one to actually check the correct location.

Testing

Loaded a save, walked up a ramp, jumped into a car, drove through some hay bales, ran over a zombie corpse that had stuff in the inventory, ran over a turkey, and smashed into a stationary vehicle. Didn't see anything odd (the changes should not change any functionality).

Additional context

Had a local environment corruption, so it had to be rebuilt. This involved downloading the latest master, creating a branch, and copy the modified files based on a previous master over it to recover the work done. This means that version tags and things like that may be wrong, However, the test was performed after recovery, so at least it's consistent internally.

Also note that typification PRs tend to mess with a lot of places, so there's a significant risk of a merge clash if this PR is merged concurrently with other code PRs.

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership Info / User Interface Game - player communication, menus, etc. Bionics CBM (Compact Bionic Modules) Map / Mapgen Overmap, Mapgen, Map extras, Map display Vehicles Vehicles, parts, mechanics & interactions Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves Appliance/Power Grid Anything to do with appliances and power grid json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 11, 2024
@Night-Pryanik
Copy link
Contributor

Could you please remove Respirator-related stuff from the PR?

@PatrikLundell
Copy link
Contributor Author

No, I'm afraid I can't, because I didn't make those changes, and I don't know how to remove changes others have made that then are claimed to be part of this PR (such as e.g. the language stuff (adding a Portugese version, I think)). I suspect they've been entered through the merging of master into the PR (and that's not made by me either), but probably done through the back door when flagging conflicts.

I'm guessing you refer to bionic changes? I can pull down the PR and change those "changes" back to what is claimed to be the "before" state. Note that when I say that I refer to a single file: if those changes are elsewhere I as well I haven't seen them (but if someone can point them out I can do the same thing to those, of course).
I'm not trying to be difficult, but rather state what my limitations are in terms of knowledge of what's going on.

@Maleclypse
Copy link
Member

Maleclypse commented Nov 22, 2024

You may have already tried this but have you rebased on top of the current master?

edit: it's entirely possible that rebasing won't change anything because those lines were changed before this PR opened and you got stuck in a weird git time loop.

@PatrikLundell
Copy link
Contributor Author

I tried to rebase, and the results compile. However, when trying to push the results it was refused because the local stuff was considered older than the remote stuff (somehow). I ended up using --force to force the stuff through, which may be incorrect, as I don't really know what I'm doing.

Copy link
Contributor

@Night-Pryanik Night-Pryanik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about that?

src/bionics.cpp Outdated Show resolved Hide resolved
src/bionics.cpp Outdated Show resolved Hide resolved
src/bionics.cpp Outdated Show resolved Hide resolved
PatrikLundell and others added 3 commits November 22, 2024 14:33
Co-authored-by: Anton Burmistrov <[email protected]>
Co-authored-by: Anton Burmistrov <[email protected]>
Co-authored-by: Anton Burmistrov <[email protected]>
@Night-Pryanik Night-Pryanik merged commit b1266d1 into CleverRaven:master Nov 22, 2024
20 of 25 checks passed
@PatrikLundell PatrikLundell deleted the typify branch November 22, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Appliance/Power Grid Anything to do with appliances and power grid astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Bionics CBM (Compact Bionic Modules) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Info / User Interface Game - player communication, menus, etc. Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display NPC / Factions NPCs, AI, Speech, Factions, Ownership Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants