summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-pathfind.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2011-03-16 23:12:22 +0100
committerRaphael Langella <raphael.langella@gmail.com>2011-03-16 23:12:22 +0100
commit48aafb78fca1d16ced2c0b9821e87e09eebc89be (patch)
tree39535c8588121be879186bacd3ac9d41dc183b0c /crawl-ref/source/mon-pathfind.cc
parent3e8b1d49f20f1f8409753a1b9c06fe287ee17a75 (diff)
downloadcrawl-ref-48aafb78fca1d16ced2c0b9821e87e09eebc89be.tar.gz
crawl-ref-48aafb78fca1d16ced2c0b9821e87e09eebc89be.zip
Monster use pathfinding to go around clouds.
Diffstat (limited to 'crawl-ref/source/mon-pathfind.cc')
-rw-r--r--crawl-ref/source/mon-pathfind.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-pathfind.cc b/crawl-ref/source/mon-pathfind.cc
index de8783469e..c95656336f 100644
--- a/crawl-ref/source/mon-pathfind.cc
+++ b/crawl-ref/source/mon-pathfind.cc
@@ -414,6 +414,9 @@ bool monster_pathfind::traversable(const coord_def& p)
// its preferred habit and capability of flight or opening doors.
bool monster_pathfind::mons_traversable(const coord_def& p)
{
+ if (mons_avoids_cloud(mons, env.cgrid(p)))
+ return false;
+
return mons_can_traverse(mons, p) || mons->can_cling_to_walls()
&& cell_is_clingable(pos)
&& cell_can_cling_to(pos, p);