summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/cloud.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-23 20:32:37 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-23 20:32:37 +0000
commit6f00e679d1f90041599c50c3cc86ab4e499c9ba1 (patch)
tree2e1ceeed3d328f639166d0ca53dddbd6fba6cdcf /crawl-ref/source/cloud.cc
parent0b1e914465f3e3f1f4c73f63cf2346c3f2253861 (diff)
downloadcrawl-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/cloud.cc')
-rw-r--r--crawl-ref/source/cloud.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc
index b38e43525b..2e5c912bb7 100644
--- a/crawl-ref/source/cloud.cc
+++ b/crawl-ref/source/cloud.cc
@@ -85,16 +85,15 @@ static int _spread_cloud(const cloud_struct &cloud)
cloud.decay > 20? 50 :
30;
int extra_decay = 0;
- radius_iterator ri(coord_def(cloud.x, cloud.y), 1, true, false, true);
- for ( ; ri; ++ri )
+ for ( adjacent_iterator ai(cloud.pos()); ai; ++ai )
{
if (random2(100) >= spreadch)
continue;
- if (!in_bounds(*ri)
- || env.cgrid(*ri) != EMPTY_CLOUD
- || grid_is_solid(grd(*ri))
- || is_sanctuary(*ri) && !is_harmless_cloud(cloud.type))
+ if (!in_bounds(*ai)
+ || env.cgrid(*ai) != EMPTY_CLOUD
+ || grid_is_solid(grd(*ai))
+ || is_sanctuary(*ai) && !is_harmless_cloud(cloud.type))
{
continue;
}
@@ -103,7 +102,7 @@ static int _spread_cloud(const cloud_struct &cloud)
if (newdecay >= cloud.decay)
newdecay = cloud.decay - 1;
- _place_new_cloud( cloud.type, *ri, newdecay, cloud.whose,
+ _place_new_cloud( cloud.type, *ai, newdecay, cloud.whose,
cloud.spread_rate );
extra_decay += 8;
@@ -395,7 +394,7 @@ beam_type cloud2beam(cloud_type flavour)
void in_a_cloud()
{
- int cl = env.cgrid[you.x_pos][you.y_pos];
+ int cl = env.cgrid(you.pos());
int hurted = 0;
int resist;