-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor item 'you could craft' section
Some failed test cases in `tests/iteminfo_test.cpp` made me realize my previous commit should have kept the `DESCRIPTION_APPLICABLE_RECIPES` check, since that is a flag indicating whether the section is applicable to that kind of item, and should be shown at all. Doing that check first made it clear that the preceding block, initializing `tid` and `known_recipes`, could move inside the `if` and avoid being needlessly calculated in some cases. Due to indentation, this looks like a larger diff than it really is, but it's all the same logic as before - if no recipes are known, the section will display "You don't know anything you could craft with it." Verified that all tests in `make check` are passing now, and confirmed in-game that messages are shown as expected.
- Loading branch information
Showing
1 changed file
with
34 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters