diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2012-01-17 00:07:38 +0100 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2012-01-17 00:25:19 +0100 |
commit | 1e4010dd04e13758da3c216baf02907f314984ed (patch) | |
tree | 49a114f0ee143226110793000889a2dc98845ed1 /crawl-ref/source/exclude.cc | |
parent | bcbd6ec1f116f367c48f341ac857a8be542e269f (diff) | |
download | crawl-ref-1e4010dd04e13758da3c216baf02907f314984ed.tar.gz crawl-ref-1e4010dd04e13758da3c216baf02907f314984ed.zip |
When placing an exclusion on a unique, don't duplicate the annotation.
Only works for new exclusions, it doesn't fix existing ones.
Also, behold C++ elegancy...
Diffstat (limited to 'crawl-ref/source/exclude.cc')
-rw-r--r-- | crawl-ref/source/exclude.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crawl-ref/source/exclude.cc b/crawl-ref/source/exclude.cc index 116fd301f9..7833e942f3 100644 --- a/crawl-ref/source/exclude.cc +++ b/crawl-ref/source/exclude.cc @@ -25,6 +25,9 @@ #include "hints.h" #include "view.h" +// defined in dgn-overview.cc +extern std::set<std::pair<std::string, level_id> > auto_unique_annotations; + static bool _mon_needs_auto_exclude(const monster* mon, bool sleepy = false) { if (mons_is_stationary(mon)) @@ -599,6 +602,12 @@ std::string exclude_set::get_exclusion_desc() if (strstr(ex.desc.c_str(), "cloud")) continue; + // Don't duplicate if there's already an annotation from unique monsters. + std::set<std::pair<std::string, level_id> >::iterator ma + = auto_unique_annotations.find(std::pair<std::string, level_id>(ex.desc, level_id::current())); + if (ma != auto_unique_annotations.end()) + continue; + if (ex.desc != "") desc.push_back(ex.desc); else |