summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-10-12 00:49:18 -0400
committerCharles Otto <ottochar@gmail.com>2009-10-12 00:50:46 -0400
commit87c2827f2914116049ee81c179a862515c684c57 (patch)
tree5bb8c2f835148266d72e3e88a2a9215758cb3d97 /crawl-ref
parente9a682d0b4089efac1360eb5bbc90ecb12ff1334 (diff)
downloadcrawl-ref-87c2827f2914116049ee81c179a862515c684c57.tar.gz
crawl-ref-87c2827f2914116049ee81c179a862515c684c57.zip
Fix infinite recursion when Sif attempts to gift high level fixed-level randart spellbooks (bug 2876139)
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/artefact.cc3
-rw-r--r--crawl-ref/source/spl-book.cc3
2 files changed, 2 insertions, 4 deletions
diff --git a/crawl-ref/source/artefact.cc b/crawl-ref/source/artefact.cc
index 9cb254c619..b612ae9226 100644
--- a/crawl-ref/source/artefact.cc
+++ b/crawl-ref/source/artefact.cc
@@ -1226,7 +1226,8 @@ static bool _init_artefact_book(item_def &book)
book.plus2 = plus2;
if (book.sub_type == BOOK_RANDART_LEVEL)
- book_good = make_book_level_randart(book);
+ // The parameters to this call are encoded in book.plus and plus2
+ book_good = make_book_level_randart(book, book.plus, book.plus2);
else
book_good = make_book_theme_randart(book);
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index 375fe300e1..33087ddb77 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -2254,16 +2254,13 @@ bool make_book_level_randart(item_def &book, int level, int num_spells,
// Being called from make_item_randart()
ASSERT(book.sub_type == BOOK_RANDART_LEVEL);
- ASSERT(level == -1 && num_spells == -1);
// Re-read owner, if applicable.
if (owner.empty() && book.props.exists("owner"))
owner = book.props["owner"].get_string();
- level = book.plus;
ASSERT(level > 0 && level <= 9);
- num_spells = book.plus2;
ASSERT(num_spells > 0 && num_spells <= SPELLBOOK_SIZE);
int god_discard = 0;