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/delay.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/delay.cc')
-rw-r--r-- | crawl-ref/source/delay.cc | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 0aec0b4f44..e4ee95d88e 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -591,38 +591,27 @@ bool is_vampire_feeding() // Returns -1, if entire audience already affected or too dumb to understand. int check_recital_audience() { - int mid; - monsters *mons; bool found_monsters = false; - for (int x = you.x_pos - 8; x <= you.x_pos + 8; x++) - for (int y = you.y_pos - 8; y <= you.y_pos + 8; y++) - { - if (!in_bounds(x,y) || !see_grid(x, y)) - continue; - - mid = mgrd[x][y]; - if (mid == NON_MONSTER) - continue; - - mons = &menv[mid]; - if (!found_monsters) - found_monsters = true; + for ( radius_iterator ri(you.pos(), 8); ri; ++ri ) + { + if ( mgrd(*ri) == NON_MONSTER ) + continue; - // Can not be affected in these states. - if (_recite_mons_useless(mons)) - continue; + found_monsters = true; + // Check if audience can listen. + if (!_recite_mons_useless( &menv[mgrd(*ri)] ) ) return (1); - } - + } + #ifdef DEBUG_DIAGNOSTICS - if (!found_monsters) - mprf(MSGCH_DIAGNOSTICS, "No audience found!"); - else - mprf(MSGCH_DIAGNOSTICS, "No sensible audience found!"); + if (!found_monsters) + mprf(MSGCH_DIAGNOSTICS, "No audience found!"); + else + mprf(MSGCH_DIAGNOSTICS, "No sensible audience found!"); #endif - + // No use preaching to the choir, nor to common animals. if (found_monsters) return (-1); |