From 168e1d08d4b24c7c4954a92b9111a07edb78ddfe Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 28 Feb 2011 21:28:26 -0800 Subject: [PATCH] stop warning about duplicate spells. --- src/kernel/magic.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/kernel/magic.c b/src/kernel/magic.c index db73632d6..fc200c3f3 100644 --- a/src/kernel/magic.c +++ b/src/kernel/magic.c @@ -430,7 +430,7 @@ update_spellbook(faction * f, int level) commonspells[numspells++] = sp; } else { if (know_school(f, sp->magietyp) && sp->level <= level) { - add_spell(&f->spellbook, sp); + ql_set_insert(&f->spellbook, sp); } } } @@ -524,13 +524,8 @@ create_mage(unit * u, magic_t mtyp) void add_spell(struct quicklist ** slistp, spell * sp) { - quicklist * ql = *slistp; - int qi; - - if (ql_set_find(&ql, &qi, sp)) { + if (ql_set_insert(slistp, sp)!=0) { log_error(("add_spell: the list already contains the spell '%s'.\n", sp->sname)); - } else { - ql_set_insert(slistp, sp); } }