summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapdef.cc
diff options
context:
space:
mode:
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);