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

allow map_cursor to be made from abs pos #75449

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

PatrikLundell
Copy link
Contributor

Summary

None

Purpose of change

Allow map_cursor to be created from an absolute position in addition to a bubble one.
Given that it's stored as an absolute position internally (except for the weirdo case which may or may not exist), it makes sense to allow it to be stored directly.
Also silenced a couple of trivial compiler warnings as a by-catch.

Describe the solution

Add another creation operation and convert the usages where an absolute position was converted into a bubble one to use the new operation instead.

Describe alternatives you've considered

  • Add operation to extract the absolute position, but there don't seem to be much use for it.
  • Address the compiler warning about game.cpp operation rate_action_eat, line 1901 which is clearly incorrect, as a check whether a value differs from either if two constants is always going to be true. The compiler suggests || should be &&, which seems reasonable. However, I don't know that's what's intended.
  • Get rid of the weirdo logic to handle usage of map_cursor prior to the existence of a valid "g" pointer. However, while I haven't seen anything clearly requiring it, I cannot rule out that there actually are cases where this is needed.

Testing

Load a save with a driving car and drive until it hit stuff. There should be no functional changes.

Additional context

@github-actions github-actions bot added Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Items: Containers Things that hold other things astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Aug 4, 2024
@dseguin dseguin merged commit c120294 into CleverRaven:master Aug 5, 2024
23 of 28 checks passed
@PatrikLundell PatrikLundell deleted the map_cursor branch August 5, 2024 06:18
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 [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Items: Containers Things that hold other things json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants