From 752b66f301b0bfbc911f3c7f42fcef1d64f7d9ed Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 22 Jan 2009 18:36:03 +0000 Subject: Commit patch by castamir: * allow placement of fixedarts and damaged/cursed items in vaults git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8699 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/randart.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crawl-ref/source/randart.cc') diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index 66f724c739..78b82ab0c7 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -1817,6 +1817,18 @@ static const char* _get_fixedart_name(const item_def &item) return (item_type_known(item) ? "Unnamed Artefact" : "buggy fixedart"); } +int get_fixedart_num( const char *name ) +{ + for (unsigned int i = 0; i < ARRAYSZ(fixedarts); ++i) + { + std::string art = fixedarts[i].name; + lowercase(art); + if (replace_all(art, " ", "_") == name) + return fixedarts[i].which; + } + return SPWPN_NORMAL; +} + // which == 0 (default) gives random fixed artefact. // Returns true if successful. bool make_item_fixed_artefact( item_def &item, bool in_abyss, int which ) -- cgit v1.2.3-54-g00ecf