Skip to content

Commit

Permalink
Dont show liquids from held or worn container in AIM [I]nventory-panel (
Browse files Browse the repository at this point in the history
#79560)

* do not show liquids in held container

* spacing

* also dont show worn content if liquid

---------

Co-authored-by: marilynias <[email protected]>
  • Loading branch information
marilynias and marilynias authored Feb 7, 2025
1 parent d311cbe commit baa0ca2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/advanced_inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,11 +914,14 @@ bool advanced_inventory::fill_lists_with_pane_items( Character &player_character
continue;
}
for( const item_location &it : listit.items ) {

// do not move liquids or gases
if( ( it->made_of_from_type( phase_id::LIQUID ) && !it->is_frozen_liquid() ) ||
it->made_of_from_type( phase_id::GAS ) ) {
continue;
}
if( dpane.get_area() == AIM_INVENTORY ) {
if( ( it->made_of_from_type( phase_id::LIQUID ) && !it->is_frozen_liquid() ) ||
it->made_of_from_type( phase_id::GAS ) ) {
continue;
}

if( !player_character.can_stash_partial( *it ) ) {
continue;
}
Expand Down
14 changes: 14 additions & 0 deletions src/advanced_inv_pane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ std::vector<advanced_inv_listitem> outfit::get_AIM_inventory( size_t &item_index
for( const std::vector<item_location> &it_stack : item_list_to_stack(
item_location( you, &worn_item ),
worn_item.all_items_top( pocket_type::CONTAINER ) ) ) {

// dont show if the content are liquids
if( !it_stack.empty() && it_stack.front()->made_of_from_type( phase_id::LIQUID ) &&
!it_stack.front()->is_frozen_liquid() ) {
continue;
}

advanced_inv_listitem adv_it( it_stack, item_index++, square.id, false );
if( !pane.is_filtered( *adv_it.items.front() ) ) {
square.volume += adv_it.volume;
Expand All @@ -158,6 +165,13 @@ std::vector<advanced_inv_listitem> avatar::get_AIM_inventory( const advanced_inv
if( weapon && weapon->is_container() ) {
for( const std::vector<item_location> &it_stack : item_list_to_stack( weapon,
weapon->all_items_top( pocket_type::CONTAINER ) ) ) {

// dont show if the content are liquids
if( !it_stack.empty() && it_stack.front()->made_of_from_type( phase_id::LIQUID ) &&
!it_stack.front()->is_frozen_liquid() ) {
continue;
}

advanced_inv_listitem adv_it( it_stack, item_index++, square.id, false );
if( !pane.is_filtered( *adv_it.items.front() ) ) {
square.volume += adv_it.volume;
Expand Down

0 comments on commit baa0ca2

Please sign in to comment.