summaryrefslogtreecommitdiffstats
path: root/crawl-ref
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
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')
-rw-r--r--crawl-ref/source/beam.cc17
-rw-r--r--crawl-ref/source/mstuff2.cc15
2 files changed, 21 insertions, 11 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
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index 7b1fa70ce2..9995f108b7 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -1346,8 +1346,8 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used)
// should really do something about mons_hit, but can't be bothered
void spore_goes_pop(struct monsters *monster)
{
- struct bolt beam;
- int type = monster->type;
+ bolt beam;
+ const int type = monster->type;
if (monster == NULL)
return;
@@ -1361,7 +1361,7 @@ void spore_goes_pop(struct monsters *monster)
beam.thrower = KILL_MON; // someone else's explosion
beam.aux_source.clear();
- const char* msg = "";
+ const char* msg = NULL;
if (type == MONS_GIANT_SPORE)
{
@@ -1372,7 +1372,7 @@ void spore_goes_pop(struct monsters *monster)
beam.ex_size = 2;
msg = "The giant spore explodes!";
}
- else
+ else if (type == MONS_BALL_LIGHTNING)
{
beam.flavour = BEAM_ELECTRICITY;
beam.name = "blast of lightning";
@@ -1381,6 +1381,13 @@ void spore_goes_pop(struct monsters *monster)
beam.ex_size = coinflip() ? 3 : 2;
msg = "The ball lightning explodes!";
}
+ else
+ {
+ msg::streams(MSGCH_DIAGNOSTICS) << "Unknown spore type: "
+ << static_cast<int>(type)
+ << std::endl;
+ return;
+ }
if (mons_near(monster))
{