stop warning about duplicate spells.

This commit is contained in:
Enno Rehling 2011-02-28 21:28:26 -08:00
parent 2af300431d
commit 168e1d08d4
1 changed files with 2 additions and 7 deletions

View File

@ -430,7 +430,7 @@ update_spellbook(faction * f, int level)
commonspells[numspells++] = sp; commonspells[numspells++] = sp;
} else { } else {
if (know_school(f, sp->magietyp) && sp->level <= level) { 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 void
add_spell(struct quicklist ** slistp, spell * sp) add_spell(struct quicklist ** slistp, spell * sp)
{ {
quicklist * ql = *slistp; if (ql_set_insert(slistp, sp)!=0) {
int qi;
if (ql_set_find(&ql, &qi, sp)) {
log_error(("add_spell: the list already contains the spell '%s'.\n", sp->sname)); log_error(("add_spell: the list already contains the spell '%s'.\n", sp->sname));
} else {
ql_set_insert(slistp, sp);
} }
} }