From 6f00e679d1f90041599c50c3cc86ab4e499c9ba1 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 23 Jul 2008 20:32:37 +0000 Subject: More cleanups and fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6648 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/cloud.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/cloud.cc') 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; -- cgit v1.2.3-54-g00ecf