summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stuff.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/stuff.cc')
-rw-r--r--crawl-ref/source/stuff.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index b4a86f9614..22726b562f 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -343,11 +343,10 @@ static bool _tag_follower_at(const coord_def &pos)
if (!in_bounds(pos) || pos == you.pos())
return (false);
- if (mgrd(pos) == NON_MONSTER)
+ monsters *fmenv = monster_at(pos);
+ if (fmenv == NULL)
return (false);
- monsters *fmenv = &menv[mgrd(pos)];
-
if (fmenv->type == MONS_PLAYER_GHOST
|| !fmenv->alive()
|| fmenv->incapacitated()
@@ -1657,8 +1656,6 @@ void zap_los_monsters()
if (g == you.pos())
continue;
- int imon = mgrd(g);
-
// At tutorial beginning disallow items in line of sight.
if (Options.tutorial_events[TUT_SEEN_FIRST_OBJECT])
{
@@ -1668,12 +1665,11 @@ void zap_los_monsters()
destroy_item(item);
}
- if (imon == NON_MONSTER || imon == MHITYOU)
- continue;
-
// If we ever allow starting with a friendly monster,
// we'll have to check here.
- monsters *mon = &menv[imon];
+ monsters *mon = monster_at(g);
+ if (mon == NULL)
+ continue;
if (mons_class_flag( mon->type, M_NO_EXP_GAIN ))
continue;