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

[AIM] Show loot in corpse pockets #53374

Merged
merged 1 commit into from
Dec 13, 2021
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
14 changes: 13 additions & 1 deletion src/advanced_inv_pane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,26 @@ void advanced_inventory_pane::add_items_from_area( advanced_inv_area &square,
square.i_stacked( square.veh->get_items( square.vstor ) ) :
square.i_stacked( m.i_at( square.pos ) );

map_cursor loc_cursor( square.pos );
for( size_t x = 0; x < stacks.size(); ++x ) {
std::vector<item_location> locs;
locs.reserve( stacks[x].size() );
for( item *const it : stacks[x] ) {
if( is_in_vehicle ) {
locs.emplace_back( vehicle_cursor( *square.veh, square.vstor ), it );
} else {
locs.emplace_back( map_cursor( square.pos ), it );
locs.emplace_back( loc_cursor, it );
if( it->is_corpse() ) {
for( item *loot : it->all_items_top( item_pocket::pocket_type::CONTAINER ) ) {
if( !is_filtered( *loot ) ) {
advanced_inv_listitem aim_item( item_location( loc_cursor, loot ), 0, loot->count(), square.id,
is_in_vehicle );
square.volume += aim_item.volume;
square.weight += aim_item.weight;
items.push_back( aim_item );
}
}
}
}
}
advanced_inv_listitem it( locs, x, square.id, is_in_vehicle );
Expand Down