From 62e6489c7a466d85c9cd3191108b027d8553c093 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 21 Nov 2018 21:46:59 +0100 Subject: [PATCH] rename variable. print error, not debug message. --- src/magic.c | 2 +- src/study.c | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/magic.c b/src/magic.c index debd8e0da..bd7edf4b8 100644 --- a/src/magic.c +++ b/src/magic.c @@ -166,7 +166,7 @@ void unit_add_spell(unit * u, struct spell * sp, int level) sc_mage *mage = get_mage(u); if (!mage) { - log_debug("adding new spell %s to a previously non-mage unit %s\n", sp->sname, unitname(u)); + log_error("adding new spell %s to a previously non-mage unit %s\n", sp->sname, unitname(u)); mage = create_mage(u, u->faction ? u->faction->magiegebiet : M_GRAY); } if (!mage->spellbook) { diff --git a/src/study.c b/src/study.c index cfb775347..977e8a7eb 100644 --- a/src/study.c +++ b/src/study.c @@ -623,7 +623,7 @@ int study_cmd(unit * u, order * ord) } if (sk == SK_MAGIC) { - magic_t mtyp; + magic_t mtype; if (u->number > 1) { cmistake(u, ord, 106, MSG_MAGIC); return -1; @@ -631,7 +631,7 @@ int study_cmd(unit * u, order * ord) if (is_familiar(u)) { /* Vertraute zaehlen nicht zu den Magiern einer Partei, * koennen aber nur Graue Magie lernen */ - mtyp = M_GRAY; + mtype = M_GRAY; } else if (!has_skill(u, SK_MAGIC)) { int mmax = skill_limit(u->faction, SK_MAGIC); @@ -641,24 +641,24 @@ int study_cmd(unit * u, order * ord) "amount", mmax)); return -1; } - mtyp = getmagicskill(u->faction->locale); - if (mtyp == M_NONE || mtyp == M_GRAY) { + mtype = getmagicskill(u->faction->locale); + if (mtype == M_NONE || mtype == M_GRAY) { /* wurde kein Magiegebiet angegeben, wird davon * ausgegangen, dass das normal gelernt werden soll */ if (u->faction->magiegebiet != 0) { - mtyp = u->faction->magiegebiet; + mtype = u->faction->magiegebiet; } else { /* Es wurde kein Magiegebiet angegeben und die Partei * hat noch keins gewaehlt. */ - mtyp = getmagicskill(u->faction->locale); - if (mtyp == M_NONE) { + mtype = getmagicskill(u->faction->locale); + if (mtype == M_NONE) { cmistake(u, ord, 178, MSG_MAGIC); return -1; } } } - if (mtyp != u->faction->magiegebiet) { + if (mtype != u->faction->magiegebiet) { /* Es wurde versucht, ein anderes Magiegebiet zu lernen * als das der Partei */ if (u->faction->magiegebiet != 0) { @@ -668,25 +668,25 @@ int study_cmd(unit * u, order * ord) else { /* Lernt zum ersten mal Magie und legt damit das * Magiegebiet der Partei fest */ - u->faction->magiegebiet = mtyp; + u->faction->magiegebiet = mtype; } } - create_mage(u, mtyp); + create_mage(u, mtype); } else { /* ist schon ein Magier und kein Vertrauter */ if (u->faction->magiegebiet == 0) { /* die Partei hat noch kein Magiegebiet gewaehlt. */ - mtyp = getmagicskill(u->faction->locale); - if (mtyp == M_NONE) { - mtyp = getmagicskill(u->faction->locale); - if (mtyp == M_NONE) { + mtype = getmagicskill(u->faction->locale); + if (mtype == M_NONE) { + mtype = getmagicskill(u->faction->locale); + if (mtype == M_NONE) { cmistake(u, ord, 178, MSG_MAGIC); return -1; } } /* Legt damit das Magiegebiet der Partei fest */ - u->faction->magiegebiet = mtyp; + u->faction->magiegebiet = mtype; } } }