summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-pathfind.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2011-04-13 15:45:42 +0200
committerRaphael Langella <raphael.langella@gmail.com>2011-04-14 00:07:52 +0200
commit99c9c6b5250168688f539d3d70a378f45ce45639 (patch)
treea3ea57e89e0318559cd2807e70be6e24bf515087 /crawl-ref/source/mon-pathfind.cc
parent36ccd8c6ef02f0e5e818971790f9ca5c0aeb2862 (diff)
downloadcrawl-ref-99c9c6b5250168688f539d3d70a378f45ce45639.tar.gz
crawl-ref-99c9c6b5250168688f539d3d70a378f45ce45639.zip
Fix pathfinding for fake amphibious.
They will take into account the higher travel cost of cells they flounder in (deep water for giants and both shallow and deep water for grey drac).
Diffstat (limited to 'crawl-ref/source/mon-pathfind.cc')
-rw-r--r--crawl-ref/source/mon-pathfind.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-pathfind.cc b/crawl-ref/source/mon-pathfind.cc
index de8783469e..61eb187190 100644
--- a/crawl-ref/source/mon-pathfind.cc
+++ b/crawl-ref/source/mon-pathfind.cc
@@ -449,12 +449,8 @@ int monster_pathfind::mons_travel_cost(coord_def npos)
// for non-amphibious monsters, so they'll avoid it where possible.
// (The resulting path might not be optimal but it will lead to a path
// a monster of such habits is likely to prefer.)
- // Only tested for shallow water since they can't enter deep water anyway.
- if (ground_level && !mons_class_habitat(mt) == HT_AMPHIBIOUS
- && (grd(pos) == DNGN_SHALLOW_WATER || grd(npos) == DNGN_SHALLOW_WATER))
- {
+ if (mons->floundering_at(npos))
return (2);
- }
// Try to avoid (known) traps.
const trap_def* ptrap = find_trap(npos);