diff --git a/src/magic.c b/src/magic.c index 7ec220875..f83e31a7d 100644 --- a/src/magic.c +++ b/src/magic.c @@ -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)); } - a = a_add(&u->attribs, a_new(&at_mage)); - mage = a->data.v; - + mage = (sc_mage *)a->data.v; mage->magietyp = mtyp; return mage; } diff --git a/src/study.c b/src/study.c index 88550fc30..9d37a7648 100644 --- a/src/study.c +++ b/src/study.c @@ -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,8 +652,7 @@ int study_cmd(unit * u, order * ord) u->faction->magiegebiet = mtyp; } } - if (!is_mage(u)) - create_mage(u, mtyp); + create_mage(u, mtyp); } else { /* ist schon ein Magier und kein Vertrauter */