summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/stuff.cc7
-rw-r--r--crawl-ref/source/stuff.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index 38b0a247c9..92ba9294ec 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -83,6 +83,13 @@ radius_iterator::radius_iterator( const coord_def& _center, int _radius,
require_los(_require_los), exclude_center(_exclude_center),
iter_done(false)
{
+ reset();
+}
+
+void radius_iterator::reset()
+{
+ iter_done = false;
+
location.x = center.x - radius;
location.y = center.y - radius;
diff --git a/crawl-ref/source/stuff.h b/crawl-ref/source/stuff.h
index 87688b5a57..66e492c7ca 100644
--- a/crawl-ref/source/stuff.h
+++ b/crawl-ref/source/stuff.h
@@ -57,6 +57,7 @@ public:
bool require_los = true,
bool exclude_center = false );
bool done() const;
+ void reset();
operator bool() const { return !done(); }
coord_def operator *() const;