From bec57e5c9d8cc6d31b9142a74885d0709019e51c Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Thu, 26 Nov 2009 23:35:06 -0800 Subject: Dumb monsters can't pathfind through secret doors --- crawl-ref/source/mon-pathfind.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/mon-pathfind.cc') 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)) { -- cgit v1.2.3-54-g00ecf