Add overflow behavior to pillbox_used and pillbox_large_used #72617
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
None
Purpose of change
Fixes overflowing pillboxes (mentioned in #72594)
Describe the solution
Set the overflow behavior of pillbox_used and pillbox_large_used to "discard" to keep them from raising errors.
Describe alternatives you've considered
Modifying pillbox_contents to not overflow pillboxes. The total possible volume of pillbox_contents isn't greater than the total capacity of a pillbox, so I suspect that the overflows are being caused by the contents not being ideally packed into each pocket, which I had not accounted for (for example, 2 10ml pockets can hold 2 1ml pills and 3 5ml pills, but only when both 1ml pills are placed in the same pocket). While it would be ideal to have a pillbox_contents who's least efficient possible packing doesn't overflow pillboxes in the first place, just adding an overflow behavior makes this much easier to maintain and much less likely to cause errors in the future.
Testing
Tested in-game using the itemgroup debug tool.
Additional context