diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-11-04 20:05:13 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-11-04 20:11:25 +0100 |
commit | 99aa489a8d75c3c23395a61ae7a34c79fc37f7e0 (patch) | |
tree | 66ec5876f3e8141c84c68ecae59c2c406af628c3 /crawl-ref/source/mapdef.cc | |
parent | 17571e019939a719da91fda064c12cc1542db98a (diff) | |
download | crawl-ref-99aa489a8d75c3c23395a61ae7a34c79fc37f7e0.tar.gz crawl-ref-99aa489a8d75c3c23395a61ae7a34c79fc37f7e0.zip |
Allow specifying "any weapon ego:XXX", "... missile", "... armour".
This will select an item type that can have brand XXX. This requires
a large list of allowable type/brand combinations in the code :(
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r-- | crawl-ref/source/mapdef.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index f12215acef..a9e0ee0412 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -3226,22 +3226,16 @@ item_spec item_list::parse_single_spec(std::string s) return (result); } + error.clear(); + // Check for "any objclass" if (s.find("any ") == 0) - { parse_random_by_class(s.substr(4), result); - return (result); - } - - if (s.find("random ") == 0) - { + else if (s.find("random ") == 0) parse_random_by_class(s.substr(7), result); - return (result); - } - // Check for actual item names. - error.clear(); - parse_raw_name(s, result); + else + parse_raw_name(s, result); if (!error.empty()) return (result); |