summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapdef.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-11-04 20:05:13 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-11-04 20:11:25 +0100
commit99aa489a8d75c3c23395a61ae7a34c79fc37f7e0 (patch)
tree66ec5876f3e8141c84c68ecae59c2c406af628c3 /crawl-ref/source/mapdef.cc
parent17571e019939a719da91fda064c12cc1542db98a (diff)
downloadcrawl-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.cc16
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);