summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 20:48:58 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 20:48:58 +0000
commitf95c6bfc4d631bb71c78d5ab47fe378ff0a02494 (patch)
tree0081e17a990737c7ed950bd2696ec7b17720b6f0 /crawl-ref/source/dungeon.cc
parenteca2b4e128181432115b49cb6371c51fa3221cec (diff)
downloadcrawl-ref-f95c6bfc4d631bb71c78d5ab47fe378ff0a02494.tar.gz
crawl-ref-f95c6bfc4d631bb71c78d5ab47fe378ff0a02494.zip
Fixed ziggurat not generating acquirement-level items.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7622 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc31
1 files changed, 20 insertions, 11 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 668115d8eb..a10f46b80b 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4619,6 +4619,16 @@ static bool _build_vaults(int level_number, const map_def *vault,
return (true);
} // end build_vaults()
+static const object_class_type _acquirement_item_classes[] = {
+ OBJ_WEAPONS,
+ OBJ_ARMOUR,
+ OBJ_WEAPONS,
+ OBJ_JEWELLERY,
+ OBJ_BOOKS,
+ OBJ_STAVES,
+ OBJ_MISCELLANY
+};
+
static void _dgn_place_item_explicit(const item_spec &spec,
const coord_def& where,
int level)
@@ -4627,10 +4637,13 @@ static void _dgn_place_item_explicit(const item_spec &spec,
if (spec.base_type == OBJ_UNASSIGNED)
return;
+ object_class_type base_type = spec.base_type;
+
if (spec.level >= 0)
level = spec.level;
else
{
+ bool adjust_type = true;
switch (spec.level)
{
case ISPEC_GOOD:
@@ -4639,10 +4652,16 @@ static void _dgn_place_item_explicit(const item_spec &spec,
case ISPEC_SUPERB:
level = MAKE_GOOD_ITEM;
break;
+ default:
+ adjust_type = false;
+ break;
}
+
+ if (adjust_type && base_type == OBJ_RANDOM)
+ base_type = RANDOM_ELEMENT(_acquirement_item_classes);
}
- const int item_made = items( spec.allow_uniques, spec.base_type,
+ const int item_made = items( spec.allow_uniques, base_type,
spec.sub_type, true, level, spec.race, 0,
spec.ego );
@@ -4981,16 +5000,6 @@ dungeon_feature_type map_feature(map_def *map, const coord_def &c, int rawfeat)
: DNGN_FLOOR); // includes everything else
}
-static const object_class_type _acquirement_item_classes[] = {
- OBJ_WEAPONS,
- OBJ_ARMOUR,
- OBJ_WEAPONS,
- OBJ_JEWELLERY,
- OBJ_BOOKS,
- OBJ_STAVES,
- OBJ_MISCELLANY
-};
-
// Returns altar_count - seems rather odd to me to force such a return
// when I believe the value is only used in the case of the ecumenical
// temple - oh, well... {dlb} (XXX)