Bugfix bei der Aufloesung von Vertrauten-Zaubern

This commit is contained in:
Enno Rehling 2003-07-11 18:37:34 +00:00
parent 3071cdb322
commit 673bcd4efd
1 changed files with 12 additions and 12 deletions

View File

@ -599,19 +599,19 @@ find_spellbyname(unit *u, const char *name, const struct locale * lang)
if (!m) return NULL;
sn = get_spellnames(lang, m->magietyp);
if (findtoken(&sn->names, name, (void**)&sp)==E_TOK_NOMATCH) {
magic_t mtype;
for(mtype=0;mtype!=MAXMAGIETYP;++mtype) {
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) {
magic_t mtype;
for(mtype=0;mtype!=MAXMAGIETYP;++mtype) {
sn = get_spellnames(lang, mtype);
if (findtoken(&sn->names, name, (void**)&sp)!=E_TOK_NOMATCH) break;
}
}
if (sp!=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);
}