diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2011-02-08 20:18:17 -0600 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2011-02-08 20:25:57 -0600 |
commit | 863eec3468747e6b0a05f59fbd61e493b7d275ff (patch) | |
tree | e963d7e59b453546574182ca8ab771ca5881ca0d /crawl-ref/source/mon-pathfind.cc | |
parent | 9a34b24c7e8016fb51c21408cdabd1ad32c29d97 (diff) | |
download | crawl-ref-863eec3468747e6b0a05f59fbd61e493b7d275ff.tar.gz crawl-ref-863eec3468747e6b0a05f59fbd61e493b7d275ff.zip |
Remove redundant ways of determining monster amphibiousness.
Some of it, at least, is a holdover from when there were two types of
it: land-primary and water-primary.
Diffstat (limited to 'crawl-ref/source/mon-pathfind.cc')
-rw-r--r-- | crawl-ref/source/mon-pathfind.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crawl-ref/source/mon-pathfind.cc b/crawl-ref/source/mon-pathfind.cc index 3a6d240a2c..857d98948c 100644 --- a/crawl-ref/source/mon-pathfind.cc +++ b/crawl-ref/source/mon-pathfind.cc @@ -357,11 +357,9 @@ std::vector<coord_def> monster_pathfind::calc_waypoints() if (path.empty()) return path; - dungeon_feature_type can_move; - if (mons_amphibious(mons)) - can_move = DNGN_DEEP_WATER; - else - can_move = DNGN_SHALLOW_WATER; + dungeon_feature_type can_move = + (mons_habitat(mons) == HT_AMPHIBIOUS) ? DNGN_DEEP_WATER + : DNGN_SHALLOW_WATER; std::vector<coord_def> waypoints; pos = path[0]; @@ -446,7 +444,7 @@ int monster_pathfind::mons_travel_cost(coord_def npos) // (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 (!airborne && !mons_class_amphibious(mt) + if (!airborne && !mons_class_habitat(mt) == HT_AMPHIBIOUS && (grd(pos) == DNGN_SHALLOW_WATER || grd(npos) == DNGN_SHALLOW_WATER)) { return (2); |