Skip to content

Commit

Permalink
Merge pull request CleverRaven#73852 from Procyonae/Backport73104
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleclypse authored May 17, 2024
2 parents f6ecd02 + e6dacfd commit 327aa9f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mondeath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ static void scatter_chunks( const itype_id &chunk_name, int chunk_amt, monster &
// can't have more items in a pile than total items
pile_size = std::min( chunk_amt, pile_size );
distance = std::abs( distance );
const item chunk( chunk_name, calendar::turn, pile_size );
const item chunk( chunk_name, calendar::turn );
map &here = get_map();
for( int i = 0; i < chunk_amt; i += pile_size ) {
int placed_chunks = 0;
while( placed_chunks < chunk_amt ) {
bool drop_chunks = true;
tripoint tarp( z.pos() + point( rng( -distance, distance ), rng( -distance, distance ) ) );
const auto traj = line_to( z.pos(), tarp );
Expand Down Expand Up @@ -127,8 +128,11 @@ static void scatter_chunks( const itype_id &chunk_name, int chunk_amt, monster &
}
}
if( drop_chunks ) {
here.add_item_or_charges( tarp, chunk );
for( int i = placed_chunks; i < chunk_amt && i < placed_chunks + pile_size; i++ ) {
here.add_item_or_charges( tarp, chunk );
}
}
placed_chunks += pile_size;
}
}

Expand Down

0 comments on commit 327aa9f

Please sign in to comment.