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 a bit of map.h/cpp + dependents #76712

Merged
merged 7 commits into from
Oct 3, 2024

Conversation

PatrikLundell
Copy link
Contributor

Summary

None

Purpose of change

  • Continue the quest to use typed coordinates rather than untyped ones.
  • Fix map::process_fields_in_submap is probably bugged #76336, bugged handling of map::process_fields_in_submap. The report was closed prematurely when the functional bug was fixed, but the incorrect type usage remained.
  • Fixed one place where typification revealed that an absolute coordinate was used as a bubble parameter. Changed that instance to convert the coordinate to a bubble one before usage, as was done in a similar call on the next line.

Describe the solution

  • Find usages of untyped map operations and convert them to usages of the corresponding typed one.
  • Remove the untyped operation if all usages had been converted.
  • getabs was processed, and it could finally be removed completely (in favor of getglobal, which returns a typed value).

Describe alternatives you've considered

Testing

Loaded a save, walked up a ramp, sat in a car, drove it through some hay bales, over some corpses (and their stuff), and hitting some random birds. Nothing weird seen.
Apart from the corrected call, there should be no functional changes. Unfortunately, I don't know how to test that change, but it can't have been vitally important, as it doesn't seem to have resulted in any visible errors.

Additional context

The going is slow... about 60 lines of map.h, out of over 3000. We're going to have to eat this elephant for a long while.

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership Missions Quests and missions Bionics CBM (Compact Bionic Modules) Map / Mapgen Overmap, Mapgen, Map extras, Map display Vehicles Vehicles, parts, mechanics & interactions Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Monsters Monsters both friendly and unfriendly. Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Mechanics: Enchantments / Spells Enchantments and spells Appliance/Power Grid Anything to do with appliances and power grid <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Sep 28, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 29, 2024
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 29, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 2, 2024
@Maleclypse Maleclypse merged commit c5c0114 into CleverRaven:master Oct 3, 2024
23 of 26 checks passed
@Maleclypse
Copy link
Member

Thank you for doing this work

@PatrikLundell PatrikLundell deleted the typify branch October 3, 2024 07:43
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) <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. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display Mechanics: Enchantments / Spells Enchantments and spells Missions Quests and missions Monsters Monsters both friendly and unfriendly. 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.

map::process_fields_in_submap is probably bugged
2 participants