summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-pathfind.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-24 22:58:06 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-24 22:58:06 -0800
commite5c79d90cf6ecf516c83ec65ccaf1f1d797a7dbb (patch)
treef3dad0daee1c1b85c6cba7fc08afa7084ed6cfbe /crawl-ref/source/mon-pathfind.cc
parent7f10f7daeea7673be54825a2551a65cbe37d6c52 (diff)
downloadcrawl-ref-e5c79d90cf6ecf516c83ec65ccaf1f1d797a7dbb.tar.gz
crawl-ref-e5c79d90cf6ecf516c83ec65ccaf1f1d797a7dbb.zip
Let monsters pathfind through doors...
if they can open them.
Diffstat (limited to 'crawl-ref/source/mon-pathfind.cc')
-rw-r--r--crawl-ref/source/mon-pathfind.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/crawl-ref/source/mon-pathfind.cc b/crawl-ref/source/mon-pathfind.cc
index a919adc204..2c4815b684 100644
--- a/crawl-ref/source/mon-pathfind.cc
+++ b/crawl-ref/source/mon-pathfind.cc
@@ -399,22 +399,24 @@ bool monster_pathfind::mons_traversable(const coord_def p)
{
const monster_type montype = mons_is_zombified(mons) ? mons_zombie_base(mons)
: mons->type;
-
- if (!mons->is_habitable_feat(grd(p)))
- return (false);
-
// 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)
{
- if (mons_is_zombified(mons))
+ if (mons->is_habitable_feat(DNGN_FLOOR))
{
- if (mons_class_itemuse(montype) < MONUSE_OPEN_DOORS)
- return (false);
+ if (mons_is_zombified(mons))
+ {
+ if (mons_class_itemuse(montype) >= MONUSE_OPEN_DOORS)
+ return (true);
+ }
+ else if (mons_itemuse(mons) >= MONUSE_OPEN_DOORS)
+ return (true);
}
- else if (mons_itemuse(mons) < MONUSE_OPEN_DOORS)
- return (false);
}
+ if (!mons->is_habitable_feat(grd(p)))
+ return (false);
+
// Your friends only know about doors you know about, unless they feel
// at home in this branch.
if (grd(p) == DNGN_SECRET_DOOR && mons->friendly()