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

Check if entire pane is liquid items before allowing moving all in AIM #37776

Merged
merged 3 commits into from Feb 7, 2020
Merged
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
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