Skip to content

Commit

Permalink
fix: quickfix for bash-related crashes (#4237)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaosvolt authored Feb 20, 2024
1 parent c95936b commit 6cc0a80
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3093,9 +3093,11 @@ void map::smash_items( const tripoint &p, const int power, const std::string &ca
if( will_explode_on_impact( power ) && it->will_explode_in_fire() ) {
return item::detonate( std::move( it ), p, contents );
}
if( ( power < min_destroy_threshold || !do_destroy ) && !it->can_revive() &&
!it->get_mtype()->zombify_into ) {
return std::move( it );
if( it->is_corpse() ) {
if( ( power < min_destroy_threshold || !do_destroy ) && !it->can_revive() &&
!it->get_mtype()->zombify_into ) {
return std::move( it );
}
}
bool is_active_explosive = it->active && it->type->get_use( "explosion" ) != nullptr;
if( is_active_explosive && it->charges == 0 ) {
Expand Down

0 comments on commit 6cc0a80

Please sign in to comment.