summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stuff.h
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/stuff.h')
-rw-r--r--crawl-ref/source/stuff.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/stuff.h b/crawl-ref/source/stuff.h
index d235407577..a29c0c07e7 100644
--- a/crawl-ref/source/stuff.h
+++ b/crawl-ref/source/stuff.h
@@ -167,6 +167,13 @@ inline bool map_bounds(const coord_def &p)
return map_bounds(p.x, p.y);
}
+// Determines if the coordinate is within bounds of an LOS array.
+inline bool show_bounds(const coord_def &p)
+{
+ return (p.x >= 0 && p.x < ENV_SHOW_DIAMETER
+ && p.y >= 0 && p.y < ENV_SHOW_DIAMETER);
+}
+
int grid_distance( const coord_def& p1, const coord_def& p2 );
int grid_distance( int x, int y, int x2, int y2 );
int distance( const coord_def& p1, const coord_def& p2 );