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

Throw error if recipe definition is missing any valid combinations #72801

Merged

Conversation

RenechCDDA
Copy link
Member

@RenechCDDA RenechCDDA commented Apr 2, 2024

Summary

None

Purpose of change

Resolves the second part of #65679

Describe the solution

Add a check at the end of checking for deduplicated recipes (when the total number of valid combinations are counted).

If there's no valid combinations at this point, there never will be and something has gone wrong. Loudly warn at the recipe definition instead of just failing silently.

Describe alternatives you've considered

Testing

Re-introduced the JSON error solved by #65761
Was successfully caught during loading, throwing the follow debugmsgs:

17:18:51.438 ERROR : \Cataclysm-DDA\src\requirements.cpp:1651 [deduped_requirement_data] Recipe definition V8_jarred somehow has no valid recipes!
17:19:00.668 ERROR : \Cataclysm-DDA\src\requirements.cpp:1651 [deduped_requirement_data] Recipe definition sauce_red_jarred_3l somehow has no valid recipes!
17:19:00.668 ERROR : \Cataclysm-DDA\src\requirements.cpp:1651 [deduped_requirement_data] Recipe definition sauce_red_jarred somehow has no valid recipes!
17:19:00.668 ERROR : \Cataclysm-DDA\src\requirements.cpp:1651 [deduped_requirement_data] Recipe definition can_tomato_jarred somehow has no valid recipes!
17:19:00.668 ERROR : \Cataclysm-DDA\src\requirements.cpp:1651 [deduped_requirement_data] Recipe definition can_tomato_jarred_3l somehow has no valid recipes!
17:19:00.668 ERROR : \Cataclysm-DDA\src\requirements.cpp:1651 [deduped_requirement_data] Recipe definition kompot_jarred_3l somehow has no valid recipes!
17:19:00.668 ERROR : \Cataclysm-DDA\src\requirements.cpp:1651 [deduped_requirement_data] Recipe definition jam_fruit_jarred somehow has no valid recipes!
17:19:00.668 ERROR : \Cataclysm-DDA\src\requirements.cpp:1651 [deduped_requirement_data] Recipe definition jam_fruit_jarred_3L somehow has no valid recipes!
17:19:00.668 ERROR : \Cataclysm-DDA\src\requirements.cpp:1651 [deduped_requirement_data] Recipe definition kompot_jarred somehow has no valid recipes!

Additional context

This does not actually resolve the issue of trying to load components as tools, nor does it warn for that specific occurrence, but it's a general catch-all for a situation that should never be possible. A generic canary is better than no canary.

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` 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 Apr 2, 2024
@I-am-Erk I-am-Erk added the 0.H Backport PR to backport to the 0.H stable release canddiate label Apr 4, 2024
@I-am-Erk I-am-Erk merged commit a1c3934 into CleverRaven:master Apr 4, 2024
24 of 29 checks passed
@RenechCDDA RenechCDDA deleted the recipe_catch_bad_requirements_set branch April 4, 2024 06:25
@Procyonae Procyonae mentioned this pull request May 12, 2024
@Procyonae Procyonae added 0.H Backported and removed 0.H Backport PR to backport to the 0.H stable release canddiate labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.H Backported astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants