Fix consume activity creation from liquid handler #76819
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
Bugfixes "Fix consume activity creation from liquid handler"
Purpose of change
Fixes #76425
Essentially reverts the changes from 717630e and implements a separate path to take for
item_location
s.Describe the solution
Add overloads to
handle_liquid
,perform_liquid_transfer
andget_liquid_target
that handleitem_location
s.Remove now unnecessary methods
handle_liquid_from_ground
andhandle_liquid_from_container
because they can be directly handled withitem_location
s.Adjusted
handle_liquid_from_container
to useitem_location
and renamed it tohandle_all_liquids_from_container
to better reflect what it actually does.Shuffled some code around and into separate methods to avoid code duplication.
Describe alternatives you've considered
Instead of renaming
handle_liquid_from_container
make it do what the comment said it does instead, but I think it makes more sense to handle everything instead of just the first liquid found. But I'm not even sure if there even are containers with multiple watertight pockets.Testing
Drank from recesses, toilets, ponds, bottles, tapped a maple tree, drank from vehicle tanks.
Additional context
As long as there is the option of making
consume_activity_actor
s from item references instead ofitem_location
s, there will be the issue that #71971 claimed to have solved:Although "consumed" here doesn't mean you actually do something with it, it just vanishes, as far as I'm aware.