summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-11 16:38:12 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-11 19:14:39 +0100
commitadb21570e7da7ff280113e938ee7a26089614e63 (patch)
tree3fe1dc829ae1826eac4a4081ed3e3c115a562d04 /crawl-ref/source/spells3.cc
parent24636262aded779e9759895c536e0f42f79c4b52 (diff)
downloadcrawl-ref-adb21570e7da7ff280113e938ee7a26089614e63.tar.gz
crawl-ref-adb21570e7da7ff280113e938ee7a26089614e63.zip
Convert another 45 monster loops to monster_iterator.
A total of 53 have been converted; 39 left, of which some should stay. Now at a net loss of lines of code for monster_iterator. Occurrences of MAX_MONSTERS down to 65 from 116 in *.cc.
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 97b2cb04d0..edca2202c5 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -35,6 +35,7 @@
#include "message.h"
#include "misc.h"
#include "mon-behv.h"
+#include "mon-iter.h"
#include "monplace.h"
#include "monstuff.h"
#include "mon-util.h"
@@ -1767,12 +1768,8 @@ bool remove_sanctuary(bool did_attack)
// Now that the sanctuary is gone, monsters aren't afraid of it
// anymore.
- for (int i = 0; i < MAX_MONSTERS; ++i)
- {
- monsters *mon = &menv[i];
- if (mon->alive())
- mons_stop_fleeing_from_sanctuary(mon);
- }
+ for (monster_iterator mi; mi; ++mi)
+ mons_stop_fleeing_from_sanctuary(*mi);
if (is_resting())
stop_running();