summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-23 13:07:05 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-23 13:07:05 +0000
commit76c82d66daed178db22ec0fe9bd91cfb23cfb28c (patch)
tree05d1029ebd67e95c404d05ad9ef5e4e46b83701e /crawl-ref/source/dungeon.cc
parentf3b465a2e3fa4d16eaf9ff89065fa3a67c2775ea (diff)
downloadcrawl-ref-76c82d66daed178db22ec0fe9bd91cfb23cfb28c.tar.gz
crawl-ref-76c82d66daed178db22ec0fe9bd91cfb23cfb28c.zip
Allow .des files to place manuals with names as "manual of Fighting" or "random manual" (dpeg).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7549 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 1a31f4fb67..a57c96010d 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4712,7 +4712,8 @@ static bool _build_vaults(int level_number, int force_vault, int rune_subst,
} // end build_vaults()
static void _dgn_place_item_explicit(const item_spec &spec,
- const coord_def& where, int level)
+ const coord_def& where,
+ int level)
{
// Dummy object?
if (spec.base_type == OBJ_UNASSIGNED)
@@ -4739,10 +4740,16 @@ static void _dgn_place_item_explicit(const item_spec &spec,
if (item_made != NON_ITEM && item_made != -1)
{
- mitm[item_made].pos = where;
+ item_def &item(mitm[item_made]);
+ item.pos = where;
+ if (is_stackable_item(item) && spec.qty > 0)
+ item.quantity = spec.qty;
- if (is_stackable_item(mitm[item_made]) && spec.qty > 0)
- mitm[item_made].quantity = spec.qty;
+ if (spec.plus >= 0 && item.base_type == OBJ_BOOKS
+ && item.sub_type == BOOK_MANUAL)
+ {
+ item.plus = spec.plus;
+ }
}
// Modify dungeon to ensure that the item is not on an invalid feature.