diff options
-rw-r--r-- | crawl-ref/docs/level_design.txt | 2 | ||||
-rw-r--r-- | crawl-ref/source/mapdef.cc | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/docs/level_design.txt b/crawl-ref/docs/level_design.txt index c5e1c66dc8..a09399129d 100644 --- a/crawl-ref/docs/level_design.txt +++ b/crawl-ref/docs/level_design.txt @@ -690,7 +690,6 @@ KMONS: ? = orc priest / w:3 deep elf priest places a rat on a shallow water square for all occurrences of Z. ---- The following feature is not yet working -------------------------------- KMONS: also allows you to specify alternative monsters if the primary monster you want to place is unavailable (because it is a unique that was already generated). For instance, if you want @@ -699,7 +698,6 @@ KMONS: ? = orc priest / w:3 deep elf priest KMONS: n = Terence, Michael, Erica, human Or if you want to pick randomly: KMONS: n = Terence / Michael / Erica, human ------------------------------------------------------------------------------ KMASK: Z = no_monster_gen diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 651f475253..0f9cb1f838 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -2993,7 +2993,14 @@ std::string keyed_mapspec::set_mons(const std::string &s, bool fix) err.clear(); mons.clear(); - return (mons.add_mons(s, fix)); + std::vector<std::string> segments = split_string(",", s); + for (int i = 0, size = segments.size(); i < size; ++i) + { + const std::string error = mons.add_mons(segments[i], fix); + if (!error.empty()) + return (error); + } + return (""); } std::string keyed_mapspec::set_item(const std::string &s, bool fix) |