summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-16 22:31:06 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-16 22:31:06 +0000
commit01d7369a6ee1ec37afc127e25388c222ebd330f3 (patch)
treeefe87386864a184e9eddd0f4b2dfda7f3390c18e /crawl-ref/source/beam.cc
parent5f8d478fbabc0d7d0d0b2360d02170f57cef2d77 (diff)
downloadcrawl-ref-01d7369a6ee1ec37afc127e25388c222ebd330f3.tar.gz
crawl-ref-01d7369a6ee1ec37afc127e25388c222ebd330f3.zip
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
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc17
1 files changed, 10 insertions, 7 deletions
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