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

Ignore autopickup setting when transfering liquids #55497

Merged
merged 1 commit into from
Feb 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ void activity_handlers::fill_liquid_do_turn( player_activity *act, Character *yo
break;
}
case liquid_target_type::CONTAINER:
you->pour_into( *act_ref.targets.at( 0 ), liquid );
you->pour_into( *act_ref.targets.at( 0 ), liquid, true );
break;
case liquid_target_type::MAP:
if( iexamine::has_keg( act_ref.coords.at( 1 ) ) ) {
Expand Down
4 changes: 2 additions & 2 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5561,7 +5561,7 @@ bool Character::sees_with_specials( const Creature &critter ) const
return false;
}

bool Character::pour_into( item &container, item &liquid )
bool Character::pour_into( item &container, item &liquid, bool ignore_settings )
{
std::string err;
const int amount = container.get_remaining_capacity_for_liquid( liquid, *this, &err );
Expand All @@ -5581,7 +5581,7 @@ bool Character::pour_into( item &container, item &liquid )

add_msg_if_player( _( "You pour %1$s into the %2$s." ), liquid.tname(), container.tname() );

liquid.charges -= container.fill_with( liquid, amount );
liquid.charges -= container.fill_with( liquid, amount, false, false, ignore_settings );
inv->unsort();

if( liquid.charges > 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ class Character : public Creature, public visitable
* possible at all. `true` indicates at least some of the liquid has been moved.
*/
/**@{*/
bool pour_into( item &container, item &liquid );
bool pour_into( item &container, item &liquid, bool ignore_settings );
bool pour_into( const vpart_reference &vp, item &liquid ) const;
/**@}*/

Expand Down
2 changes: 1 addition & 1 deletion src/handle_liquid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static bool perform_liquid_transfer( item &liquid, const tripoint *const source_
// not on ground or similar. TODO: implement storing arbitrary container locations.
if( target.item_loc && create_activity() ) {
serialize_liquid_target( player_character.activity, target.item_loc );
} else if( player_character.pour_into( *target.item_loc, liquid ) ) {
} else if( player_character.pour_into( *target.item_loc, liquid, true ) ) {
if( target.item_loc->needs_processing() ) {
// Polymorphism fail, have to introspect into the type to set the target container as active.
switch( target.item_loc.where() ) {
Expand Down