forked from github/server
create_mage sollte ein existierendes at_mage nicht überschreiben, nur evtl. aktualisieren.
This commit is contained in:
parent
9d1e1a2e32
commit
a175c84232
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue