summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monster.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-31 09:19:11 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-01 21:44:15 +0100
commitafca77968d2a0591591a1b0792b2083558d6c3bc (patch)
treee3b74baa2b8292a4eb376fca7dd2eff1207c1e69 /crawl-ref/source/monster.cc
parent842722ca2c40bb838d908677677d6096963e879d (diff)
downloadcrawl-ref-afca77968d2a0591591a1b0792b2083558d6c3bc.tar.gz
crawl-ref-afca77968d2a0591591a1b0792b2083558d6c3bc.zip
Special case source==target in num_feats_between.
This was causing a crash through monsters::mon_see_cell. Also special case monster position there.
Diffstat (limited to 'crawl-ref/source/monster.cc')
-rw-r--r--crawl-ref/source/monster.cc2
1 files changed, 2 insertions, 0 deletions
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);