summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/item_use.cc15
-rw-r--r--crawl-ref/source/monstuff.cc4
-rw-r--r--crawl-ref/source/view.cc1
3 files changed, 9 insertions, 11 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 269984cfa6..34c092385b 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -4693,22 +4693,19 @@ static void _vulnerability_scroll()
// Go over all creatures in LOS.
for (radius_iterator ri(you.pos(), LOS_RADIUS); ri; ++ri)
{
- const unsigned short targ_monst = env.mgrid(*ri);
- if (targ_monst != NON_MONSTER)
+ if (monsters* mon = monster_at(*ri))
{
// Dispel all magical enchantments.
- monsters& mon = menv[targ_monst];
for (unsigned int i = 0; i < ARRAYSZ(lost_enchantments); ++i)
- mon.del_ench(lost_enchantments[i], true, true);
+ mon->del_ench(lost_enchantments[i], true, true);
// If relevant, monsters have their MR halved.
- if (!mons_immune_magic(&mon))
- mon.add_ench(lowered_mr);
+ if (!mons_immune_magic(mon))
+ mon->add_ench(lowered_mr);
// Annoying but not enough to turn friendlies against you.
- // XXX: This will turn allies of int >= I_NORMAL hostile.
- // Not intended?
- behaviour_event(&mon, ME_ANNOY, MHITYOU);
+ if (!mons_wont_attack(mon))
+ behaviour_event(mon, ME_ANNOY, MHITYOU);
}
}
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index a8436b306d..328a02357e 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -871,7 +871,7 @@ static void _mummy_curse(monsters* monster, killer_type killer, int index)
else
{
// Mummies committing suicide don't cause a death curse.
- if (index == static_cast<int>(monster_index(monster)))
+ if (index == monster->mindex())
return;
target = &menv[index];
}
@@ -4220,7 +4220,7 @@ static void _handle_behaviour(monsters *mon)
if (mon->behaviour == BEH_FLEE)
{
// Monster is safe, so stay put.
- mon->target.set(mon->pos().x, mon->pos().y);
+ mon->target = mon->pos();
mon->foe = MHITNOT;
}
}
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index c29fad0504..2120a69bab 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -1406,6 +1406,7 @@ bool check_awaken(monsters* monster)
// You didn't wake the monster!
if (player_light_armour(true)
+ && you.can_see(monster) // to avoid leaking information
&& you.burden_state == BS_UNENCUMBERED
&& you.special_wield != SPWLD_SHADOW
&& !mons_wont_attack(monster)