Skip to content

Commit

Permalink
Merge pull request #46872 from BrettDong/trap
Browse files Browse the repository at this point in the history
Fix trap's trigger_weight being ignored if less than 500g
  • Loading branch information
ZhilkinSerg authored Jan 22, 2021
2 parents f29270c + fa8cb35 commit 3ca62f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/ballistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ static void drop_or_embed_projectile( const dealt_projectile_attack &attack )
} else {
sounds::sound( pt, 8, sounds::sound_t::combat, _( "thud." ), false, "bullet_hit", "hit_wall" );
}
const trap &tr = here.tr_at( pt );
if( tr.triggered_by_item( dropped_item ) ) {
tr.trigger( pt, dropped_item );
}
}

const trap &tr = here.tr_at( pt );
if( tr.triggered_by_item( dropped_item ) ) {
tr.trigger( pt, dropped_item );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/trap.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct trap {
/**
* If an item with this weight or more is thrown onto the trap, it triggers.
*/
units::mass trigger_weight = units::mass( -1, units::mass::unit_type{} );
units::mass trigger_weight = 500_gram;
int funnel_radius_mm = 0;
// For disassembly?
std::vector<std::tuple<itype_id, int, int>> components;
Expand Down

0 comments on commit 3ca62f6

Please sign in to comment.