summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/coord.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-06-05 04:20:28 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-06-05 05:22:53 +0530
commit2897d3537f6904d23672f9a049ed3c1600b06319 (patch)
tree2a7b6a6fe01e1030c8d4b5b18b4d3cd747b942bd /crawl-ref/source/coord.cc
parent9b4b45760d9cc79ec482d7a4b2f89092a3edefce (diff)
downloadcrawl-ref-2897d3537f6904d23672f9a049ed3c1600b06319.tar.gz
crawl-ref-2897d3537f6904d23672f9a049ed3c1600b06319.zip
Abyss code cleanup.
Clean up the code involved in generating and shifting the abyss. This is spadework in preparation for abyss vaults. Fixes abyss shifts copying the area around the player to the centre of the abyss and not clearing the old area (irc conversation between Linley and dpeg confirms that the old behaviour of not clearing the duplicate shifted terrain is a bug). Fixes abyssal runes being more likely to appear at the NW of the abyss level, particularly as time spent in the abyss increases.
Diffstat (limited to 'crawl-ref/source/coord.cc')
-rw-r--r--crawl-ref/source/coord.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/coord.cc b/crawl-ref/source/coord.cc
index cabce47429..8e689a4127 100644
--- a/crawl-ref/source/coord.cc
+++ b/crawl-ref/source/coord.cc
@@ -82,6 +82,12 @@ bool map_bounds(int x, int y)
return (map_bounds_x(x) && map_bounds_y(y));
}
+bool map_bounds_with_margin(coord_def p, int margin)
+{
+ return (p.x >= X_BOUND_1 + margin && p.x <= X_BOUND_2 - margin
+ && p.y >= Y_BOUND_1 + margin && p.y <= Y_BOUND_2 - margin);
+}
+
coord_def random_in_bounds()
{
if (crawl_state.game_is_arena())