diff --git a/src/common/gamecode/study.c b/src/common/gamecode/study.c index d3f25e1a6..b333c6bdb 100644 --- a/src/common/gamecode/study.c +++ b/src/common/gamecode/study.c @@ -140,6 +140,11 @@ teach_unit(unit * teacher, unit * student, int teaching, skill_t sk, boolean rep * n ist die Anzahl zusätzlich gelernter Tage. n darf max. die Differenz * von schon gelernten Tagen zum max(30 Tage pro Mann) betragen. */ + if (magic_lowskill(student)){ + cmistake(teacher, teacher->thisorder, 274, MSG_EVENT); + return 0; + } + #ifdef RANDOMIZED_LEARNING n = student->number * dice(2,30); #else @@ -238,11 +243,6 @@ teach(region * r, unit * u) return; } - if (magic_lowskill(u2)){ - cmistake(u, u->thisorder, 274, MSG_EVENT); - return; - } - teaching = u->number * 30 * TEACHNUMBER; if ((i = get_effect(u, oldpotiontype[P_FOOL])) > 0) { /* Trank "Dumpfbackenbrot" */ diff --git a/src/common/kernel/magic.c b/src/common/kernel/magic.c index 05525a361..644c142f7 100644 --- a/src/common/kernel/magic.c +++ b/src/common/kernel/magic.c @@ -1930,7 +1930,7 @@ spellparameter * add_spellparameter(region *target_r, unit *u, const char *syntax, char *s, int skip) { - int i = 0; + int i = 1; int c = 0; int l = 0; char *tbuf, *token; @@ -1970,7 +1970,7 @@ add_spellparameter(region *target_r, unit *u, const char *syntax, strcpy(tbuf, s); token = strtok (tbuf, " "); while(token && syntax[c] != 0) { - if (i >= skip) { + if (i > skip) { if (syntax[c] == '+') { /* das vorhergehende Element kommt ein oder mehrmals vor, wir * springen zum key zurück */ diff --git a/src/common/util/base36.c b/src/common/util/base36.c index 1aa659da4..549454dc0 100644 --- a/src/common/util/base36.c +++ b/src/common/util/base36.c @@ -23,6 +23,7 @@ #include "base36.h" #include +#include #ifdef HAVE_STRTOL int @@ -36,7 +37,7 @@ int atoi36(const char * s) { int i = 0; - + assert(s); if(!(*s)) return 0; while(!isalnum((int)*s)) ++s;