summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/travel.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-26 04:43:58 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-26 04:43:58 +0000
commit7124f889e3c585947d594aa38be346bc87c08069 (patch)
tree40f1109c243083f31c69f4cd4f545a638833c194 /crawl-ref/source/travel.cc
parent8921c5b2703c3aa590026bbc8052ba129b6fc02c (diff)
downloadcrawl-ref-7124f889e3c585947d594aa38be346bc87c08069.tar.gz
crawl-ref-7124f889e3c585947d594aa38be346bc87c08069.zip
Simplify checks for grids containing water.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8763 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/travel.cc')
-rw-r--r--crawl-ref/source/travel.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 6d569f1462..70eb8e867c 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -536,8 +536,10 @@ static bool _is_reseedable(int x, int y)
return (true);
int grid = grd[x][y];
- return (grid == DNGN_DEEP_WATER || grid == DNGN_SHALLOW_WATER
- || grid == DNGN_LAVA || is_trap(x, y) || _is_monster_blocked(x, y));
+ return (grid_is_water(grid)
+ || grid == DNGN_LAVA
+ || is_trap(x, y)
+ || _is_monster_blocked(x, y));
}
// Returns true if the square at (x,y) is okay to travel over. If ignore_hostile
@@ -702,9 +704,9 @@ void initialise_travel()
int get_feature_type(const std::string &feature)
{
if (feature.find("deep water") != std::string::npos)
- return DNGN_DEEP_WATER;
+ return (DNGN_DEEP_WATER);
if (feature.find("shallow water") != std::string::npos)
- return DNGN_SHALLOW_WATER;
+ return (DNGN_SHALLOW_WATER);
return -1;
}
@@ -1794,8 +1796,7 @@ bool travel_pathfind::path_flood(const coord_def &c, const coord_def &dc)
if (dc != start
&& (feature != DNGN_FLOOR
- && feature != DNGN_SHALLOW_WATER
- && feature != DNGN_DEEP_WATER
+ && grid_is_water(feature)
&& feature != DNGN_LAVA
|| is_waypoint(dc)
|| is_stash(ls, dc.x, dc.y)))