forked from github/server
rerun with default_locale in case spellname not found
This commit is contained in:
parent
bb38c8c86a
commit
13be7184aa
1 changed files with 6 additions and 5 deletions
|
@ -594,7 +594,7 @@ find_spellbyname(unit *u, char *name, const struct locale * lang)
|
||||||
{
|
{
|
||||||
spell_ptr *spt;
|
spell_ptr *spt;
|
||||||
sc_mage * m = get_mage(u);
|
sc_mage * m = get_mage(u);
|
||||||
spell * sp;
|
spell * sp = NULL;
|
||||||
spell_names * sn;
|
spell_names * sn;
|
||||||
|
|
||||||
if (!m) return NULL;
|
if (!m) return NULL;
|
||||||
|
@ -605,12 +605,13 @@ find_spellbyname(unit *u, char *name, const struct locale * lang)
|
||||||
sn = get_spellnames(lang, m->magietyp);
|
sn = get_spellnames(lang, m->magietyp);
|
||||||
if (findtoken(&sn->names, name, (void**)&sp)!=E_TOK_NOMATCH) break;
|
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!=NULL) {
|
||||||
if (sp->id==spt->spellid) return sp;
|
for (spt = m->spellptr; spt; spt = spt->next) {
|
||||||
}
|
if (sp->id==spt->spellid) return sp;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (lang==default_locale) return NULL;
|
if (lang==default_locale) return NULL;
|
||||||
return find_spellbyname(u, name, default_locale);
|
return find_spellbyname(u, name, default_locale);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue