summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-10-24 23:55:03 +0200
committerAdam Borowski <kilobyte@angband.pl>2009-10-24 23:59:12 +0200
commit0773235a1b546eafbb369690adc9852d474ffd99 (patch)
treefcca306f57663c61fee965be6e751637117be1d3 /crawl-ref/source/effects.cc
parentf0f31671b06a7f64198b15ddd72e5b7a781ca30d (diff)
downloadcrawl-ref-0773235a1b546eafbb369690adc9852d474ffd99.tar.gz
crawl-ref-0773235a1b546eafbb369690adc9852d474ffd99.zip
Make it possible for demigods to get the hard books [BR 2883646] (sorear)
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 029d3a62b6..2446309443 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1634,7 +1634,7 @@ static int _spell_weight(spell_type spell)
// weights of all unknown spells in the book.
static int _book_weight(int book)
{
- ASSERT(book >= 0 && book <= MAX_NORMAL_BOOK);
+ ASSERT(book >= 0 && book <= MAX_FIXED_BOOK);
int total_weight = 0;
for (int i = 0; i < SPELLBOOK_SIZE; i++)
@@ -1746,9 +1746,14 @@ static bool _do_book_acquirement(item_def &book, int agent)
int total_weights = 0;
// Pick a random spellbook according to unknown spells contained.
- int weights[MAX_NORMAL_BOOK+1];
- for (int bk = 0; bk <= MAX_NORMAL_BOOK; bk++)
+ int weights[MAX_FIXED_BOOK+1];
+ for (int bk = 0; bk <= MAX_FIXED_BOOK; bk++)
{
+ if (bk > MAX_NORMAL_BOOK && agent == GOD_SIF_MUNA)
+ {
+ weights[bk] = 0;
+ continue;
+ }
weights[bk] = _book_weight(bk);
total_weights += weights[bk];
}