From 01d7369a6ee1ec37afc127e25388c222ebd330f3 Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 16 Sep 2007 22:31:06 +0000 Subject: Explosions no longer trigger a more() if you don't see any squares of the explosion. Fixes 1790761. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2117 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 36aa6cb31b..4fed730bd2 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -4371,11 +4371,7 @@ void explosion( bolt &beam, bool hole_in_the_middle, noisy( 10 + 5*r, beam.target_x, beam.target_y ); // set map to false - for (int i=0; i<19; i++) - { - for (int j=0; j<19; j++) - explode_map[i][j] = false; - } + explode_map.init(false); // discover affected cells - recursion is your friend! // this is done to model an explosion's behaviour around @@ -4444,6 +4440,13 @@ void explosion( bolt &beam, bool hole_in_the_middle, drawing = false; } + bool seen_anything = false; + for ( int i = -9; i <= 9; ++i ) + for ( int j = -9; j <= 9; ++j ) + if ( explode_map[i+9][j+9] && + see_grid(beam.target_x + i, beam.target_y + j) ) + seen_anything = true; + // ---------------- end boom -------------------------- #ifdef WIN32CONSOLE @@ -4453,7 +4456,7 @@ void explosion( bolt &beam, bool hole_in_the_middle, // duplicate old behaviour - pause after entire explosion // has been drawn. - if (!beam.is_tracer) + if (!beam.is_tracer && seen_anything) more(); } @@ -4526,7 +4529,7 @@ static void explosion_map( bolt &beam, int x, int y, // 3. check to see if we're blocked by something // specifically, we're blocked by WALLS. Not // statues, idols, etc. - int dngn_feat = grd[beam.target_x + x][beam.target_y + y]; + const int dngn_feat = grd[beam.target_x + x][beam.target_y + y]; // special case: explosion originates from rock/statue // (e.g. Lee's rapid deconstruction) - in this case, ignore -- cgit v1.2.3-54-g00ecf