diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/los.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/monster.cc | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index 282ddba85c..cff3c128be 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -752,6 +752,9 @@ int num_feats_between(const coord_def& source, const coord_def& target, int count = 0; int max_dist = grid_distance(source, target); + if (source == target) + return (0); // XXX: might want to count the cell. + // We don't need to find the shortest beam, any beam will suffice. fallback_ray(source, target, ray); diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index b6fc7c0bd1..374135686e 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -4900,6 +4900,8 @@ bool monsters::visible_to(const actor *looker) const bool monsters::mon_see_cell(const coord_def& p, bool reach) const { + if (p == pos()) + return (true); if (distance(pos(), p) > LOS_RADIUS * LOS_RADIUS + 1) return (false); |