From afca77968d2a0591591a1b0792b2083558d6c3bc Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sat, 31 Oct 2009 09:19:11 +0100 Subject: Special case source==target in num_feats_between. This was causing a crash through monsters::mon_see_cell. Also special case monster position there. --- crawl-ref/source/monster.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crawl-ref/source/monster.cc') 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); -- cgit v1.2.3-54-g00ecf