From 99aa489a8d75c3c23395a61ae7a34c79fc37f7e0 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Wed, 4 Nov 2009 20:05:13 +0100 Subject: 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 :( --- crawl-ref/source/mapdef.cc | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'crawl-ref/source/mapdef.cc') 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); -- cgit v1.2.3-54-g00ecf