Skip to content

Commit

Permalink
Fucking hell
Browse files Browse the repository at this point in the history
Sort of works but non-count_by_charges harvest materials don't stack when spawning for some reason?
  • Loading branch information
KheirFerrum committed Jun 9, 2024
1 parent 0cf0765 commit f3e4798
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7263,19 +7263,25 @@ void map::loadn( const tripoint &grid, const bool update_vehicles )
template <typename Container>
void map::remove_rotten_items( Container &items, const tripoint &pnt, temperature_flag temperature )
{
items.remove_with( [this, &pnt, &temperature]( detached_ptr<item> &&it ) {
std::vector<item *> corpses_handle;
items.remove_with( [this, &pnt, &temperature, &corpses_handle]( detached_ptr<item> &&it ) {
item &obj = *it;
it = item::actualize_rot( std::move( it ), pnt, temperature, get_weather() );
// When !it, that means the item was removed from the world, ie: has rotted.
if( !it ) {
if( obj.is_comestible() ) {
rotten_item_spawn( obj, pnt );
} else if( obj.is_corpse() ) {
handle_decayed_corpse( obj, pnt );
corpses_handle.push_back( &obj );
}
}
return std::move( it );
} );

for( const item *corpse : corpses_handle ) {
handle_decayed_corpse( *corpse, pnt );
}

}

void map::handle_decayed_corpse( const item &it, const tripoint &pnt )
Expand Down

0 comments on commit f3e4798

Please sign in to comment.