Skip to content

Commit

Permalink
Check if entire pane is liquid items before allowing moving all in AIM (
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpwbrown authored Feb 7, 2020
1 parent 3569c49 commit 9aa7645
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/advanced_inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,15 @@ bool advanced_inventory::move_all_items( bool nested_call )
}

// Check some preconditions to quickly leave the function.
if( spane.items.empty() ) {
size_t liquid_items = 0;
for( const advanced_inv_listitem elem : spane.items ) {
for( const item *elemit : elem.items ) {
if( elemit->made_of_from_type( LIQUID ) && !elemit->is_frozen_liquid() ) {
liquid_items++;
}
}
}
if( spane.items.empty() || liquid_items == spane.items.size() ) {
return false;
}
bool restore_area = false;
Expand Down

0 comments on commit 9aa7645

Please sign in to comment.