diff options
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r-- | crawl-ref/source/item_use.cc | 15 |
1 files changed, 6 insertions, 9 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); } } |