summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-pathfind.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-26 23:35:06 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-26 23:36:19 -0800
commitbec57e5c9d8cc6d31b9142a74885d0709019e51c (patch)
tree517c885fcfac0fc653078d432a659508c3d6b97b /crawl-ref/source/mon-pathfind.cc
parentaed5e7f8d9cd47a4560a998237c33419bfe2b09b (diff)
downloadcrawl-ref-bec57e5c9d8cc6d31b9142a74885d0709019e51c.tar.gz
crawl-ref-bec57e5c9d8cc6d31b9142a74885d0709019e51c.zip
Dumb monsters can't pathfind through secret doors
Diffstat (limited to 'crawl-ref/source/mon-pathfind.cc')
-rw-r--r--crawl-ref/source/mon-pathfind.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/mon-pathfind.cc b/crawl-ref/source/mon-pathfind.cc
index e7fc8c503c..173d643020 100644
--- a/crawl-ref/source/mon-pathfind.cc
+++ b/crawl-ref/source/mon-pathfind.cc
@@ -401,8 +401,13 @@ bool monster_pathfind::mons_traversable(const coord_def p)
{
const monster_type montype = mons_is_zombified(mons) ? mons_zombie_base(mons)
: mons->type;
- // Monsters that can't open doors won't be able to pass them.
- if (feat_is_closed_door(grd(p)) || grd(p) == DNGN_SECRET_DOOR)
+ const dungeon_feature_type feat = grd(p);
+ // Monsters that can't open doors won't be able to pass them, and
+ // only monsters of normal or greater intelligence can pathfind through
+ // secret doors.
+ if (feat == DNGN_CLOSED_DOOR ||
+ (mons_intel(mons) >= I_NORMAL &&
+ (feat == DNGN_DETECTED_SECRET_DOOR || feat == DNGN_SECRET_DOOR)))
{
if (mons->is_habitable_feat(DNGN_FLOOR))
{