summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/coordit.h
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-02-23 20:00:19 -0500
committerNeil Moore <neil@s-z.org>2014-02-23 20:02:50 -0500
commitc2328442afdce263a890bf45d22657b10cd4bbe3 (patch)
tree88b01dc299ba4571bb7019085cab7e8ecfe839ec /crawl-ref/source/coordit.h
parent7f5c0d692c6173e5e05734313882f1d5fbe9afcf (diff)
downloadcrawl-ref-c2328442afdce263a890bf45d22657b10cd4bbe3.tar.gz
crawl-ref-c2328442afdce263a890bf45d22657b10cd4bbe3.zip
Don't crash when sanctuary shrinks near the map edge
See for example: http://crawl.lantea.net/crawl/morgue/letownia/crash-letownia-20140224-004021.txt Introduced by 0.14-a0-622-g0c137b5, which replaced radius_iterator with C_SQUARE by rectangle_iterator. Unfortunately, the latter did not clip the iterator to the map. Add a flag to do so: false by default because iterated rectangles are not always in map coordinates.
Diffstat (limited to 'crawl-ref/source/coordit.h')
-rw-r--r--crawl-ref/source/coordit.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/crawl-ref/source/coordit.h b/crawl-ref/source/coordit.h
index f5bbdb8e38..cd5b7d1e25 100644
--- a/crawl-ref/source/coordit.h
+++ b/crawl-ref/source/coordit.h
@@ -7,7 +7,8 @@ class rectangle_iterator : public iterator<forward_iterator_tag, coord_def>
{
public:
rectangle_iterator(const coord_def& corner1, const coord_def& corner2);
- rectangle_iterator(const coord_def& center, int halfside);
+ rectangle_iterator(const coord_def& center, int halfside,
+ bool clip_to_map = false);
explicit rectangle_iterator(int x_border_dist, int y_border_dist = -1);
operator bool() const PURE;
coord_def operator *() const PURE;