From ff38d8bf4c18d2705ad9320408f2cd2864a42044 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 20 Aug 2015 12:10:34 +0200 Subject: [PATCH] I don't think it's good to call update_spells before the turn. one should only have the spells that are in the previous week's report. a few comments wouldn't hurt. --- src/laws.c | 1 - src/magic.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/laws.c b/src/laws.c index b867b9f14..9a62ac53f 100755 --- a/src/laws.c +++ b/src/laws.c @@ -4531,7 +4531,6 @@ void processorders(void) init_processor(); init = 1; } - update_spells(); process(); /*************************************************/ diff --git a/src/magic.c b/src/magic.c index 72fe72a25..9ad9e0ad9 100644 --- a/src/magic.c +++ b/src/magic.c @@ -464,11 +464,13 @@ void pick_random_spells(faction * f, int level, spellbook * book, int num_spells spellno = rng_int() % maxspell; sbe = commonspells[spellno]; if (sbe->level > f->max_spelllevel) { + // not going to pick it in this round, move it to the end for later commonspells[spellno] = commonspells[--maxspell]; commonspells[maxspell] = sbe; sbe = 0; } else if (f->spellbook && spellbook_get(f->spellbook, sbe->sp)) { + // already have this spell, remove it from the list of candidates commonspells[spellno] = commonspells[--numspells]; if (maxspell > numspells) { maxspell = numspells;