Skip to content

Commit

Permalink
Merge pull request #48712 from Zeropol/shatter_item_dont_destroy
Browse files Browse the repository at this point in the history
Remove items that shatter instead of dropping them intact
  • Loading branch information
Rivet-the-Zombie authored May 4, 2021
2 parents 935b5c8 + 8c2deb4 commit 67105a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ballistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ static void drop_or_embed_projectile( const dealt_projectile_attack &attack )
if( effects.count( "SHATTER_SELF" ) ) {
// Drop the contents, not the thrown item
add_msg_if_player_sees( pt, _( "The %s shatters!" ), drop_item.tname() );
drop_item.visit_items( [&pt]( const item * it, item * ) {
get_map().add_item_or_charges( pt, *it );
return VisitResponse::NEXT;
} );

// copies the drop item to spill the contents
item( drop_item ).spill_contents( pt );

// TODO: Non-glass breaking
// TODO: Wine glass breaking vs. entire sheet of glass breaking
Expand Down

0 comments on commit 67105a9

Please sign in to comment.