Skip to content

Commit

Permalink
Shockwaves don't cross z-levels
Browse files Browse the repository at this point in the history
  • Loading branch information
Fris0uman committed Nov 20, 2019
1 parent 14e05ae commit 533b9b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/explosion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,13 +577,19 @@ void shockwave( const tripoint &p, int radius, int force, int stun, int dam_mult
"misc", "shockwave" );

for( monster &critter : g->all_monsters() ) {
if( critter.posz() != p.z ) {
continue;
}
if( rl_dist( critter.pos(), p ) <= radius ) {
add_msg( _( "%s is caught in the shockwave!" ), critter.name() );
g->knockback( p, critter.pos(), force, stun, dam_mult );
}
}
// TODO: combine the two loops and the case for g->u using all_creatures()
for( npc &guy : g->all_npcs() ) {
if( guy.posz() != p.z ) {
continue;
}
if( rl_dist( guy.pos(), p ) <= radius ) {
add_msg( _( "%s is caught in the shockwave!" ), guy.name );
g->knockback( p, guy.pos(), force, stun, dam_mult );
Expand Down

0 comments on commit 533b9b2

Please sign in to comment.