Skip to content

Commit

Permalink
drink from furniture (CleverRaven#48817)
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Granade <[email protected]>
  • Loading branch information
Saicchi and kevingranade authored Jul 9, 2021
1 parent c1159c2 commit f074436
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/game_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_SAPROPHAGE( "SAPROPHAGE" );
static const trait_id trait_SAPROVORE( "SAPROVORE" );

static const std::string flag_LIQUIDCONT( "LIQUIDCONT" );

using item_filter = std::function<bool ( const item & )>;
using item_location_filter = std::function<bool ( const item_location & )>;

Expand Down Expand Up @@ -667,7 +669,10 @@ class comestible_inventory_preset : public inventory_selector_preset
std::string get_denial( const item_location &loc ) const override {
const item &med = *loc;

if( loc->made_of_from_type( phase_id::LIQUID ) && loc.where() != item_location::type::container ) {
if(
( loc->made_of_from_type( phase_id::LIQUID ) &&
loc.where() != item_location::type::container ) &&
!get_map().has_flag_furn( flag_LIQUIDCONT, loc.position() ) ) {
return _( "Can't drink spilt liquids." );
}

Expand Down

0 comments on commit f074436

Please sign in to comment.