diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2011-07-18 21:17:15 +0200 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2011-07-18 21:17:15 +0200 |
commit | d1a6b44afdae609eb57bb8d252f81a2541a68174 (patch) | |
tree | dd80f2538eedbef45b458648a7fb1623c653f287 /crawl-ref/source/mon-pathfind.cc | |
parent | 15903b95090a7d6ccadd19b91dbb19aa1ba18254 (diff) | |
download | crawl-ref-d1a6b44afdae609eb57bb8d252f81a2541a68174.tar.gz crawl-ref-d1a6b44afdae609eb57bb8d252f81a2541a68174.zip |
Simplify the monster movement code.
There's no need to pass the can_move feature all over the place. Also, it
makes it much simpler to make monster use pathfinding to avoid other stuff.
Diffstat (limited to 'crawl-ref/source/mon-pathfind.cc')
-rw-r--r-- | crawl-ref/source/mon-pathfind.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-pathfind.cc b/crawl-ref/source/mon-pathfind.cc index 2d8618fdc0..e45460aa39 100644 --- a/crawl-ref/source/mon-pathfind.cc +++ b/crawl-ref/source/mon-pathfind.cc @@ -355,10 +355,6 @@ std::vector<coord_def> monster_pathfind::calc_waypoints() if (path.empty()) return path; - dungeon_feature_type can_move = - (mons_habitat(mons) == HT_AMPHIBIOUS) ? DNGN_DEEP_WATER - : DNGN_SHALLOW_WATER; - std::vector<coord_def> waypoints; pos = path[0]; @@ -367,7 +363,7 @@ std::vector<coord_def> monster_pathfind::calc_waypoints() #endif for (unsigned int i = 1; i < path.size(); i++) { - if (can_go_straight(mons, pos, path[i], can_move) + if (can_go_straight(mons, pos, path[i]) && mons_traversable(path[i])) { continue; |