summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-13 21:59:47 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-13 22:51:35 +0100
commitd958695281c7c79be672abda7cdaf673c27514e6 (patch)
treee7d88894f39703160b6b3bfa3c5599d1dd3f9a76 /crawl-ref/source/spells2.cc
parent2021591fae6918624a49d21849ebd2ca35ff9ff2 (diff)
downloadcrawl-ref-d958695281c7c79be672abda7cdaf673c27514e6.tar.gz
crawl-ref-d958695281c7c79be672abda7cdaf673c27514e6.zip
Convert a bunch of coordinate loops to new radius_iterator.
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index e0378e81f4..4e0a3c366f 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -80,7 +80,7 @@ int detect_items(int pow)
int items_found = 0;
const int map_radius = 8 + random2(8) + pow;
- for (radius_iterator ri(you.pos(), map_radius, true, false); ri; ++ri)
+ for (radius_iterator ri(you.pos(), map_radius, C_SQUARE); ri; ++ri)
{
// Don't expose new dug out areas:
// Note: assumptions are being made here about how
@@ -193,7 +193,7 @@ int detect_creatures(int pow, bool telepathic)
if (!telepathic)
clear_map(false);
- for (radius_iterator ri(you.pos(), map_radius, true, false); ri; ++ri)
+ for (radius_iterator ri(you.pos(), map_radius, C_SQUARE); ri; ++ri)
{
if (monsters *mon = monster_at(*ri))
{
@@ -219,13 +219,11 @@ int detect_creatures(int pow, bool telepathic)
void corpse_rot()
{
- for (radius_iterator ri(you.pos(), 6); ri; ++ri)
+ for (radius_iterator ri(you.pos(), 6, C_ROUND, &you.get_los_no_trans());
+ ri; ++ri)
{
- if (you.see_cell_no_trans(*ri) && !is_sanctuary(*ri)
- && env.cgrid(*ri) == EMPTY_CLOUD)
- {
+ if (!is_sanctuary(*ri) && env.cgrid(*ri) == EMPTY_CLOUD)
for (stack_iterator si(*ri); si; ++si)
- {
if (si->base_type == OBJ_CORPSES && si->sub_type == CORPSE_BODY)
{
// Found a corpse. Skeletonise it if possible.
@@ -239,8 +237,6 @@ void corpse_rot()
// Don't look for more corpses here.
break;
}
- }
- }
}
if (player_can_smell())