summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-19 16:21:44 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-19 16:21:44 +0000
commit629dc981dae8ee039ceeb09e7ca4f249aa445130 (patch)
treeef3c147c0280c2ee234f9da50046527a3b65ad0c
parent7cfae909af95fc2a633a0aa25e5d644677fe4a52 (diff)
downloadcrawl-ref-629dc981dae8ee039ceeb09e7ca4f249aa445130.tar.gz
crawl-ref-629dc981dae8ee039ceeb09e7ca4f249aa445130.zip
Applying r6611 to 0.4.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6612 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index b536d310a9..cb26d20b5b 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -5528,22 +5528,27 @@ static void _explosion_cell(bolt &beam, int x, int y, bool drawOnly)
static void _explosion_map( bolt &beam, int x, int y,
int count, int dir, int r )
{
- // 1. Check to see out of range.
+ // Check to see out of range.
if (x*x + y*y > r*r + r)
return;
- // 2. Check count.
+ // Check count.
if (count > 10*r)
return;
+
+ const coord_def loc(beam.target_x + x, beam.target_y + y);
- // 3. Check sanctuary.
- if (is_sanctuary(beam.target_x + x, beam.target_y + y))
+ // Make sure we haven't run off the map.
+ if (map_bounds(loc))
return;
- // 4. Check to see if we're blocked by something
- // specifically, we're blocked by WALLS. Not
- // statues, idols, etc.
- const int dngn_feat = grd[beam.target_x + x][beam.target_y + y];
+ // Check sanctuary.
+ if (is_sanctuary(loc.x, loc.y))
+ return;
+
+ // Check to see if we're blocked by something specifically, we're blocked
+ // by WALLS. Not statues, idols, etc.
+ const int dngn_feat = grd(loc);
// Special case: Explosion originates from rock/statue
// (e.g. Lee's rapid deconstruction) - in this case, ignore