Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix consume activity creation from liquid handler #76819

Merged

Conversation

mqrause
Copy link
Contributor

@mqrause mqrause commented Oct 5, 2024

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_locations.

Describe the solution

Add overloads to handle_liquid, perform_liquid_transfer and get_liquid_target that handle item_locations.
Remove now unnecessary methods handle_liquid_from_ground and handle_liquid_from_container because they can be directly handled with item_locations.
Adjusted handle_liquid_from_container to use item_location and renamed it to handle_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_actors from item references instead of item_locations, there will be the issue that #71971 claimed to have solved:

  1. If you examine a water source, select the "consume" option, then back out (e.g. because you decide the toilet tank water is too gross, or because you're full), a unit of water is still consumed from the source

Although "consumed" here doesn't mean you actually do something with it, it just vanishes, as far as I'm aware.

@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Oct 5, 2024
@mqrause mqrause force-pushed the liquid_handler_item_location branch from 20f8ea8 to d720102 Compare October 5, 2024 00:53
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 5, 2024
@mqrause mqrause force-pushed the liquid_handler_item_location branch from d720102 to 7c93bac Compare October 5, 2024 04:51
… where possible, revert item reference uses to create consume activity from that instead of faulty item_locations
@mqrause mqrause force-pushed the liquid_handler_item_location branch from 7c93bac to 6347d16 Compare October 5, 2024 13:17
@Maleclypse
Copy link
Member

compiled and tested. Thanks!

@Maleclypse Maleclypse merged commit 442da86 into CleverRaven:master Oct 7, 2024
21 of 26 checks passed
@mqrause mqrause deleted the liquid_handler_item_location branch October 7, 2024 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consuming water from a pond results as consuming a "null"
2 participants