diff options
author | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2010-06-23 19:01:37 +0530 |
---|---|---|
committer | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2010-07-24 22:33:12 +0530 |
commit | 6d20cd8e06befb42d68b69adbe7c2929ee173a26 (patch) | |
tree | 9b1b1edb7130ff1a2176126dd2f9f22ee23be47c /crawl-ref/source/mapmark.cc | |
parent | 4730d9a383f2fea31818c9c9220b32e231295229 (diff) | |
download | crawl-ref-6d20cd8e06befb42d68b69adbe7c2929ee173a26.tar.gz crawl-ref-6d20cd8e06befb42d68b69adbe7c2929ee173a26.zip |
ASSERT in world_reacts if markers are not activated.
Diffstat (limited to 'crawl-ref/source/mapmark.cc')
-rw-r--r-- | crawl-ref/source/mapmark.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc index c1c390394e..09c20adcff 100644 --- a/crawl-ref/source/mapmark.cc +++ b/crawl-ref/source/mapmark.cc @@ -644,6 +644,11 @@ void map_markers::init_from(const map_markers &c) } } +void map_markers::clear_need_activate() +{ + have_inactive_markers = false; +} + void map_markers::activate_all(bool verbose) { for (dgn_marker_map::iterator i = markers.begin(); @@ -662,11 +667,30 @@ void map_markers::activate_all(bool verbose) if (!marker->property("post_activate_remove").empty()) remove(marker); } + + have_inactive_markers = false; +} + +void map_markers::activate_markers_at(coord_def p) +{ + const std::vector<map_marker *> activatees = get_markers_at(p); + for (int i = 0, size = activatees.size(); i < size; ++i) + activatees[i]->activate(); + + const std::vector<map_marker *> active_markers = get_markers_at(p); + for (int i = 0, size = active_markers.size(); i < size; ++i) + { + const std::string prop = + active_markers[i]->property("post_activate_remove"); + if (!prop.empty()) + remove(active_markers[i]); + } } void map_markers::add(map_marker *marker) { markers.insert(dgn_pos_marker(marker->pos, marker)); + have_inactive_markers = true; } void map_markers::unlink_marker(const map_marker *marker) |