summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapmark.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-07-24 22:55:41 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-07-24 22:55:54 +0530
commit8b35f8ad24f037869aaa1d699b1b446ca0d40372 (patch)
treec0c6286561a2adb8b1ca27a6251e17f582e7481f /crawl-ref/source/mapmark.cc
parenta00a272778fc4e94ae7e1e75d31a726d6266f5ef (diff)
downloadcrawl-ref-8b35f8ad24f037869aaa1d699b1b446ca0d40372.tar.gz
crawl-ref-8b35f8ad24f037869aaa1d699b1b446ca0d40372.zip
Clear have_inactive_markers if all markers are removed.
This is just for least surprise.
Diffstat (limited to 'crawl-ref/source/mapmark.cc')
-rw-r--r--crawl-ref/source/mapmark.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc
index e5e0aa9fe1..6111173942 100644
--- a/crawl-ref/source/mapmark.cc
+++ b/crawl-ref/source/mapmark.cc
@@ -708,10 +708,17 @@ void map_markers::unlink_marker(const map_marker *marker)
}
}
+void map_markers::check_empty()
+{
+ if (markers.empty())
+ have_inactive_markers = false;
+}
+
void map_markers::remove(map_marker *marker)
{
unlink_marker(marker);
delete marker;
+ check_empty();
}
void map_markers::remove_markers_at(const coord_def &c,
@@ -728,6 +735,7 @@ void map_markers::remove_markers_at(const coord_def &c,
markers.erase(todel);
}
}
+ check_empty();
}
map_marker *map_markers::find(const coord_def &c, map_marker_type type)
@@ -839,6 +847,7 @@ void map_markers::clear()
i != markers.end(); ++i)
delete i->second;
markers.clear();
+ check_empty();
}
static const long MARKERS_COOKY = 0x17742C32;