diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-23 20:32:37 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-23 20:32:37 +0000 |
commit | 6f00e679d1f90041599c50c3cc86ab4e499c9ba1 (patch) | |
tree | 2e1ceeed3d328f639166d0ca53dddbd6fba6cdcf /crawl-ref/source/misc.cc | |
parent | 0b1e914465f3e3f1f4c73f63cf2346c3f2253861 (diff) | |
download | crawl-ref-6f00e679d1f90041599c50c3cc86ab4e499c9ba1.tar.gz crawl-ref-6f00e679d1f90041599c50c3cc86ab4e499c9ba1.zip |
More cleanups and fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6648 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 2394fa650d..0c105aa9b3 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1151,16 +1151,13 @@ static void maybe_bloodify_square(const coord_def& where, int amount, if (spatter) { // Smaller chance of spattering surrounding squares. - for ( radius_iterator ri(where, 1, true, false); ri; ++ri ) + for ( adjacent_iterator ai(where); ai; ++ai ) { - if ( *ri == where ) // current square - continue; - // Spattering onto walls etc. less likely. - if (grd(*ri) < DNGN_MINMOVE && !one_chance_in(3)) + if (grd(*ai) < DNGN_MINMOVE && !one_chance_in(3)) continue; - maybe_bloodify_square(*ri, amount/15); + maybe_bloodify_square(*ai, amount/15); } } } @@ -1181,18 +1178,18 @@ void bleed_onto_floor(const coord_def& where, int montype, static void _spatter_neighbours(const coord_def& where, int chance) { - for ( radius_iterator ri(where, 1, true, false); ri; ++ri ) + for ( adjacent_iterator ai(where, false); ai; ++ai ) { - if (!allow_bleeding_on_square(*ri)) + if (!allow_bleeding_on_square(*ai)) continue; - if (grd(*ri) < DNGN_MINMOVE && !one_chance_in(3)) + if (grd(*ai) < DNGN_MINMOVE && !one_chance_in(3)) continue; if (one_chance_in(chance)) { - env.map(*ri).property = FPROP_BLOODY; - _spatter_neighbours(*ri, chance+1); + env.map(*ai).property = FPROP_BLOODY; + _spatter_neighbours(*ai, chance+1); } } } |