summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-damage.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-11-04 19:20:56 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-11-05 05:14:16 +0100
commit5114b4b827b5b56b3f5e6a204c682c3ac77ad755 (patch)
tree183b95a620df7b62a21223605ad877f85beb75cc /crawl-ref/source/spl-damage.cc
parent1f1809d2796684ad03af05bea3754acb0e2e513d (diff)
downloadcrawl-ref-5114b4b827b5b56b3f5e6a204c682c3ac77ad755.tar.gz
crawl-ref-5114b4b827b5b56b3f5e6a204c682c3ac77ad755.zip
Get rid of the radius_iterator "legacy" constructor.
It was really weird: working on a square, but in almost all cases restricting it to your view (a circle). Note this is _your_ view rather than from the iterator's center -- which hasn't been used once in the obvious interesting way. As usual, this commit fixes a load of "act through glass" bugs, ando/or using los modes that don't make sense in the context.
Diffstat (limited to 'crawl-ref/source/spl-damage.cc')
-rw-r--r--crawl-ref/source/spl-damage.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/crawl-ref/source/spl-damage.cc b/crawl-ref/source/spl-damage.cc
index 9892763770..d72e0a4e71 100644
--- a/crawl-ref/source/spl-damage.cc
+++ b/crawl-ref/source/spl-damage.cc
@@ -2410,7 +2410,7 @@ actor* forest_near_enemy(const actor *mon)
{
const coord_def pos = mon->pos();
- for (radius_iterator ri(pos, LOS_RADIUS); ri; ++ri)
+ for (radius_iterator ri(pos, LOS_NO_TRANS); ri; ++ri)
{
actor* foe = actor_at(*ri);
if (!foe || mons_aligned(foe, mon))
@@ -2427,10 +2427,9 @@ actor* forest_near_enemy(const actor *mon)
// Print a message only if you can see any affected trees.
void forest_message(const coord_def pos, const string &msg, msg_channel_type ch)
{
- for (radius_iterator ri(pos, LOS_RADIUS); ri; ++ri)
+ for (radius_iterator ri(pos, LOS_DEFAULT); ri; ++ri)
if (feat_is_tree(grd(*ri))
- && cell_see_cell(you.pos(), *ri, LOS_DEFAULT)
- && cell_see_cell(pos, *ri, LOS_DEFAULT))
+ && cell_see_cell(you.pos(), *ri, LOS_DEFAULT))
{
mpr(msg, ch);
return;
@@ -2451,7 +2450,7 @@ void forest_damage(const actor *mon)
"Tree limbs sway around you.",
0), MSGCH_TALK_VISUAL);
- for (radius_iterator ri(pos, LOS_RADIUS); ri; ++ri)
+ for (radius_iterator ri(pos, LOS_NO_TRANS); ri; ++ri)
{
actor* foe = actor_at(*ri);
if (!foe || mons_aligned(foe, mon))
@@ -2461,7 +2460,7 @@ void forest_damage(const actor *mon)
continue;
for (adjacent_iterator ai(*ri); ai; ++ai)
- if (feat_is_tree(grd(*ai)) && cell_see_cell(pos, *ai, LOS_DEFAULT))
+ if (feat_is_tree(grd(*ai)) && cell_see_cell(pos, *ai, LOS_NO_TRANS))
{
int evnp = foe->melee_evasion(mon, EV_IGNORE_PHASESHIFT);
int dmg = 0;