From 76c82d66daed178db22ec0fe9bd91cfb23cfb28c Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 23 Nov 2008 13:07:05 +0000 Subject: 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 --- crawl-ref/source/dungeon.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/dungeon.cc') 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. -- cgit v1.2.3-54-g00ecf