diff --git a/src/common/kernel/magic.c b/src/common/kernel/magic.c index cd37f11a9..606b5bd01 100644 --- a/src/common/kernel/magic.c +++ b/src/common/kernel/magic.c @@ -862,6 +862,33 @@ spellcost(unit *u, spell * sp) return aura; } +/* ------------------------------------------------------------- */ +/* SPC_LINEAR ist am höchstwertigen, dann müssen Komponenten für die + * Stufe des Magiers vorhanden sein. + * SPC_LINEAR hat die gewünschte Stufe als multiplikator, + * nur SPC_FIX muss nur einmal vorhanden sein, ist also am + * niedrigstwertigen und sollte von den beiden anderen Typen + * überschrieben werden */ +int +spl_costtyp(spell * sp) +{ + int k; + int costtyp = SPC_FIX; + + for (k = 0; k < MAXINGREDIENT; k++) { + if (costtyp == SPC_LINEAR) return SPC_LINEAR; + + if (sp->komponenten[k][2] == SPC_LINEAR) { + return SPC_LINEAR; + } + + if (costtyp==SPC_FIX) { + costtyp = SPC_LEVEL; + } + } + return costtyp; +} + /* ------------------------------------------------------------- */ /* durch Komponenten und cast_level begrenzter maximal möglicher * Level @@ -2866,9 +2893,13 @@ magic(void) continue; } if (level < co->level){ - sprintf(buf, "%s hat nur genügend Komponenten um %s auf Stufe %d " - "zu zaubern.", unitname(u), sp->name, level); - addmessage(0, u->faction, buf, MSG_MAGIC, ML_INFO); + /* Sprüche mit Fixkosten werden immer auf Stufe des Spruchs + * gezaubert, co->level ist aber defaultmäßig Stufe des Magiers */ + if (spl_costtyp(sp) != SPC_FIX) { + sprintf(buf, "%s hat nur genügend Komponenten um %s auf Stufe %d " + "zu zaubern.", unitname(u), sp->name, level); + addmessage(0, u->faction, buf, MSG_MAGIC, ML_INFO); + } } co->level = level; diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index ce524b42d..d425be8e0 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -1367,10 +1367,7 @@ sail(region * starting_point, unit * u, region * next_point, boolean move_on_lan * befahrene Region. */ tt[step] = starting_point; - while (current_point!=next_point && - ((rterrain(current_point) == T_OCEAN - || is_cursed(u->ship->attribs, C_SHIP_FLYING, 0)) - && next_point != 0 && m < k)) + while (current_point!=next_point && m < k && next_point) { direction_t dir = reldirection(current_point, next_point); @@ -1515,6 +1512,7 @@ sail(region * starting_point, unit * u, region * next_point, boolean move_on_lan rv[l] = current_point; l++; } + if (rterrain(current_point) != T_OCEAN && !is_cursed(u->ship->attribs, C_SHIP_FLYING, 0)) break; next_point = movewhere(current_point, u); }