diff options
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 9ad32ef80d..4ed5d9b690 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -8043,18 +8043,19 @@ bool monsters::mon_see_cell(const coord_def& p, bool reach) const true, true)); } -bool monsters::can_see(const actor *targ) const +bool monsters::see_cell(const coord_def &c) const { - if (this == targ) - return (visible_to(targ)); - - if (!targ->visible_to(this)) - return (false); + // XXX: using env.show since that's been filled anywa. + if (c == you.pos()) + return (you.see_cell(pos())); - if (targ->atype() == ACT_PLAYER) - return (mons_near(this)); + // TODO: Proper monster LOS. + return (mon_see_cell(c)); +} - return (mon_see_cell(targ->pos())); +bool monsters::can_see(const actor *targ) const +{ + return (targ->visible_to(this) && see_cell(targ->pos())); } bool monsters::can_mutate() const |