summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-09-27 22:29:43 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-06 17:25:29 +0200
commit98a1e903da70af439ccc66120fd721401bd5b6e3 (patch)
tree94ac1a309c3b1afe2f91e967898e635723663e3e
parent357ace6f451882e1fc1aadbeebac1e7b89bc714e (diff)
downloadcrawl-ref-98a1e903da70af439ccc66120fd721401bd5b6e3.tar.gz
crawl-ref-98a1e903da70af439ccc66120fd721401bd5b6e3.zip
Use inclusive bounds for grid_is_{solid,opaque}.
-rw-r--r--crawl-ref/source/enum.h3
-rw-r--r--crawl-ref/source/terrain.cc4
2 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index a586496844..adfef29372 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -1018,6 +1018,9 @@ enum dungeon_feature_type
DNGN_GRANITE_STATUE = 21, // 21
DNGN_STATUE_RESERVED,
+ // Highest solid grid value.
+ DNGN_MAXSOLID = DNGN_STATUE_RESERVED,
+
// Lowest grid value which can be passed by walking etc.
DNGN_MINMOVE = 31,
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index ad8ace64e9..cdd0ef6a43 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -186,12 +186,12 @@ command_type grid_stair_direction(dungeon_feature_type grid)
bool grid_is_opaque(dungeon_feature_type grid)
{
- return (grid < DNGN_MINSEE);
+ return (grid <= DNGN_MAXOPAQUE);
}
bool grid_is_solid(dungeon_feature_type grid)
{
- return (grid < DNGN_MINMOVE);
+ return (grid <= DNGN_MAXSOLID);
}
bool grid_is_solid(int x, int y)