create_mage sollte ein existierendes at_mage nicht überschreiben, nur evtl. aktualisieren.

This commit is contained in:
Enno Rehling 2017-10-08 09:10:41 +02:00
parent 9d1e1a2e32
commit a175c84232
2 changed files with 4 additions and 9 deletions

View File

@ -488,12 +488,10 @@ sc_mage *create_mage(unit * u, magic_t mtyp)
attrib *a;
a = a_find(u->attribs, &at_mage);
if (a != NULL) {
a_remove(&u->attribs, a);
}
if (a == NULL) {
a = a_add(&u->attribs, a_new(&at_mage));
mage = a->data.v;
}
mage = (sc_mage *)a->data.v;
mage->magietyp = mtyp;
return mage;
}

View File

@ -613,8 +613,6 @@ int study_cmd(unit * u, order * ord)
/* Vertraute zaehlen nicht zu den Magiern einer Partei,
* koennen aber nur Graue Magie lernen */
mtyp = M_GRAY;
if (!is_mage(u))
create_mage(u, mtyp);
}
else if (!has_skill(u, SK_MAGIC)) {
int mmax = skill_limit(u->faction, SK_MAGIC);
@ -654,7 +652,6 @@ int study_cmd(unit * u, order * ord)
u->faction->magiegebiet = mtyp;
}
}
if (!is_mage(u))
create_mage(u, mtyp);
}
else {