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

Remove extern ter ids #72766

Merged
merged 16 commits into from Apr 4, 2024
Merged

Conversation

Procyonae
Copy link
Contributor

@Procyonae Procyonae commented Apr 1, 2024

Summary

None

Purpose of change

Remove everything but t_null from the ancient (Pre 0.A) int_id<ter_t> list from mapdata.h/.cpp
Extern evil idk

Describe the solution

Changes references to the extern list for static const string_id<ter_t> definitions at the top of each file that uses them in line with other ids
Uses ter_str_id::NULL_id() instead for t_null

Left a few instances of t_null that were being awkward, if someone more technically adept wants to attack them here's the list

mapdata.cpp L64
mapgen.cpp L854 L4376 L5144 L7690
regional_settings.h L100 L283
submap.h L318

Changes a few excessive checks to use unordered_set and find instead

Describe alternatives you've considered

I were going to just remove the ones that aren't referenced anymore but anothersimulacrum and kevingranade both advocated for changing to using string_id<ter_t>s per file

Keeping the ids as t_ as opposed to the currently used ter_t_ for string ids and instead changing existing ter_t_ to t_ but that's probably at least just as intrusive and other types of static id use the existing format

Not causing myself merge conflicts

Testing

Game compiles and loads fine

I wouldn't be surprised if there's some random place the int_id -> string_id causes an issue that I haven't noticed and the tests don't catch but hopefully it's nothing major

Additional context

There's alot of stuff that can be replaced with flag/ter_furn_transforms instead of needing to use hardcoded ids, might attack some in future PRs

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership Missions Quests and missions Map / Mapgen Overmap, Mapgen, Map extras, Map display Vehicles Vehicles, parts, mechanics & interactions Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Scenarios New Scenarios, balancing, bugs with scenarios Player Faction Base / Camp All about the player faction base/camp/site labels Apr 1, 2024
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Apr 1, 2024
Copy link
Contributor

@nornagon nornagon left a comment

Choose a reason for hiding this comment

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

You're a saint

src/mapgen.cpp Outdated Show resolved Hide resolved
src/recipe.cpp Outdated Show resolved Hide resolved
Procyonae and others added 3 commits April 2, 2024 13:41
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
@github-actions github-actions bot added the Code: Tests Measurement, self-control, statistics, balancing. label Apr 2, 2024
@github-actions github-actions bot added Monsters Monsters both friendly and unfriendly. EOC: Effects On Condition Anything concerning Effects On Condition Info / User Interface Game - player communication, menus, etc. labels Apr 2, 2024
src/mapgen_functions.h Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Apr 2, 2024
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Apr 2, 2024
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 2, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 3, 2024
@kevingranade kevingranade merged commit e9f4fbd into CleverRaven:master Apr 4, 2024
26 checks passed
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 EOC: Effects On Condition Anything concerning Effects On Condition Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions Monsters Monsters both friendly and unfriendly. NPC / Factions NPCs, AI, Speech, Factions, Ownership Player Faction Base / Camp All about the player faction base/camp/site Scenarios New Scenarios, balancing, bugs with scenarios Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants