From beec74e0c6e71c39fb1e30f0d228ef4372918c73 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 8 Aug 2010 23:39:21 -0700 Subject: [PATCH] Clearing every mage's spell-list before each turn is counter-productive. It destroys tests, and it doesn't let us have special spells added per-unit. --- src/bindings/bind_unit.c | 4 +++- src/gamecode/laws.c | 8 -------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/bindings/bind_unit.c b/src/bindings/bind_unit.c index 9de137d90..7084571d8 100644 --- a/src/bindings/bind_unit.c +++ b/src/bindings/bind_unit.c @@ -522,7 +522,9 @@ unit_addspell(unit * u, const char * name) slist=slist->next; } if (!spadd) log_error(("spell %s could not be found\n", name)); - else add_spell(starget, spadd); + else { + add_spell(starget, spadd); + } } static int diff --git a/src/gamecode/laws.c b/src/gamecode/laws.c index c5cb1173e..dc638e047 100644 --- a/src/gamecode/laws.c +++ b/src/gamecode/laws.c @@ -3596,14 +3596,6 @@ update_spells(void) if (FactionSpells() && maxlevel>f->max_spelllevel) { update_spellbook(f, maxlevel); - for (i=0;i!=n;++i) { - sc_mage *mage = get_mage(mages[i]); - while (mage->spells) { - spell_list * slist = mage->spells; - mage->spells = slist->next; - free(slist); - } - } } for (i=0;i!=n;++i) { updatespelllist(mages[i]);