summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-27 13:54:08 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-27 13:54:08 +0000
commit12c403b697ccdab148c55ab2d634f3ee424c0cc0 (patch)
treeef4228789b04a2083297ee436885c1446476f3d1 /crawl-ref/source
parent62ba7977a2d7085a7ee0232fa317293c878f9365 (diff)
downloadcrawl-ref-12c403b697ccdab148c55ab2d634f3ee424c0cc0.tar.gz
crawl-ref-12c403b697ccdab148c55ab2d634f3ee424c0cc0.zip
Explosion weren't propagating along diagonal tunnels (like those made by
a wand of digging). Fixed by making _explosion_map() recurse in all 8 directions instead of just north/south/east/west; might introduce some problems that I'm not aware of. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7654 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/beam.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index cd600a3ba6..a15a94a0da 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -5050,7 +5050,7 @@ int explosion( bolt &beam, bool hole_in_the_middle,
// corners where a simple 'line of sight' isn't quite
// enough. This might be slow for really big explosions,
// as the recursion runs approximately as R^2.
- _explosion_map(beam, coord_def(0, 0), 0, 0, r);
+ _explosion_map(beam, coord_def(0, 0), 0, -1, r);
// Go through affected cells, drawing effect and
// calling affect() for each. Now, we get a bit
@@ -5233,21 +5233,17 @@ static void _explosion_map( bolt &beam, const coord_def& p,
// Hmm, I think we're ok.
explode_map(p + coord_def(9,9)) = true;
- const coord_def spread[] = { coord_def(0, -1), coord_def( 0, 1),
- coord_def(1, 0), coord_def(-1, 0) };
- const int opdir[] = { 2, 1, 4, 3 };
-
// Now recurse in every direction except the one we came from.
- const int spreadsize = ARRAYSZ(spread);
- for (int i = 0; i < spreadsize; i++)
+ for (int i = 0; i < 8; i++)
{
- if (i+1 != dir)
+ if ((i + 1) != dir)
{
int cadd = 5;
- if (p.x * spread[i].x < 0 || p.y * spread[i].y < 0)
+ if (p.x * Compass[i].x < 0 || p.y * Compass[i].y < 0)
cadd = 17;
- _explosion_map( beam, p + spread[i], count + cadd, opdir[i], r );
+ _explosion_map( beam, p + Compass[i], count + cadd,
+ (i + 4) % 8, r );
}
}
}