summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stuff.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/stuff.cc')
-rw-r--r--crawl-ref/source/stuff.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index 099f0b81f5..fb9ea9b870 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -1101,6 +1101,12 @@ bool map_bounds( int x, int y )
&& y >= Y_BOUND_1 && y <= Y_BOUND_2);
}
+coord_def random_in_bounds()
+{
+ return coord_def( random_range(MAPGEN_BORDER, GXM - MAPGEN_BORDER - 1),
+ random_range(MAPGEN_BORDER, GYM - MAPGEN_BORDER - 1) );
+}
+
// Returns a random location in (x_pos, y_pos)... the grid will be
// DNGN_FLOOR if clear, and NON_MONSTER if empty. Exclusive tells
// if we're using in_bounds() or map_bounds() restriction.