Warn if consume_drug item has unused vitamins #83310
Open
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
Bugfixes "Fix some cases where food with consume_drug would not give vitamins and vice versa "
Purpose of change
Take an aspirin. Notice that you do not receive any vit_bloodthinner.
Put some calcium tablets into the faction camp's larder. Notice that they do not confer any vitamins.
The consume_drug_iuse actor can contain a vitamins field to optionally give vitamins. The items with this tend to be but don't have to be (I think??) comestibles. If the item has calories/vitamins defined in comestible they won't be added to the consumer's body.
Describe the solution
The least worst solution: Warn on load and force people to duplicate this stuff in json
Describe alternatives you've considered
Shuffle the comestible's vitamins field into the iuse actor somehow. AWFUL. Do not want.
Pray for E to eat food and a to activate it, no mixes #76920
Extract consume_drug iuse out into an islot? 😩
--Force it into comestible, somehow??
Testing
Not done testing, but also needs some testing.
In particular this is a fragile solution, it relies on the finalization order of itype's use functions and comestible data. I am really not happy with this.
Currently(with only one commit) should expect to fail basic build. No JSON work has been done.
Additional context