rerun with default_locale in case spellname not found

This commit is contained in:
Enno Rehling 2002-10-27 10:04:06 +00:00
parent bb38c8c86a
commit 13be7184aa

View file

@ -594,7 +594,7 @@ find_spellbyname(unit *u, char *name, const struct locale * lang)
{
spell_ptr *spt;
sc_mage * m = get_mage(u);
spell * sp;
spell * sp = NULL;
spell_names * sn;
if (!m) return NULL;
@ -605,12 +605,13 @@ find_spellbyname(unit *u, char *name, const struct locale * lang)
sn = get_spellnames(lang, m->magietyp);
if (findtoken(&sn->names, name, (void**)&sp)!=E_TOK_NOMATCH) break;
}
if (mtype==MAXMAGIETYP) return NULL;
}
for (spt = m->spellptr; spt; spt = spt->next) {
if (sp->id==spt->spellid) return sp;
}
if (sp!=NULL) {
for (spt = m->spellptr; spt; spt = spt->next) {
if (sp->id==spt->spellid) return sp;
}
}
if (lang==default_locale) return NULL;
return find_spellbyname(u, name, default_locale);
}