From 533b9b237930e4fb700b92d4555271dbc431ded7 Mon Sep 17 00:00:00 2001 From: Fris0uman Date: Wed, 20 Nov 2019 19:53:30 +0100 Subject: [PATCH] Shockwaves don't cross z-levels --- src/explosion.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/explosion.cpp b/src/explosion.cpp index c9b9c2e50352c..659139538a8d2 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -577,6 +577,9 @@ 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 ); @@ -584,6 +587,9 @@ void shockwave( const tripoint &p, int radius, int force, int stun, int 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 );