move islot_comestible::nutr to islot_comestible::kcal #28521
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "internally store kcal instead of nutr values"
Purpose of change
Since the move to Calories being the energy type derived from food, nutrition is slowly losings its meaning. i am replacing
nutr
withkcal
as the actual value that the game uses. This is mainly because kcal is a larger number, and with it will reduce rounding errors with the various calculations that food does. The obvious change that players will see is that foods will increase in displayed calories anywhere from 0-8 kcal per food item. As of right now this does not affect hunger, but in future PRs it will.Describe the solution
Find instances where
nutr
is called and substitute for kcal. some areas where nutr is used stay the same, and a new get_nutrition() function is made in itype for quick and easy translationAdditional Context
because of the change, it was necessary to make some more edits to recipes in order to pass the unit tests.