catch attempts to cast a spell without the magic skill

This commit is contained in:
Enno Rehling 2021-04-09 21:30:26 +02:00
parent 14e2e96c73
commit e3f2ca9aaf
1 changed files with 31 additions and 29 deletions

View File

@ -2563,6 +2563,7 @@ static castorder *cast_cmd(unit * u, order * ord)
* Vertrauter einen Spruch seines Magiers zaubert, dessen halbes Talent.
*/
skill = effskill(u, SK_MAGIC, NULL);
if (skill > 0) {
sp = unit_getspell(u, s, u->faction->locale);
/*
@ -2577,7 +2578,7 @@ static castorder *cast_cmd(unit * u, order * ord)
/* wir zaubern selbst */
mage = u;
}
else if (skill > 0) {
else {
/* als Vertrauter suchen wir einen Spender-Magier mit dem Spruch */
mage = get_familiar_mage(u);
if (mage) {
@ -2594,8 +2595,9 @@ static castorder *cast_cmd(unit * u, order * ord)
familiar = u;
}
}
/* OBS: hier kein else! */
if (!sp) {
}
if (!sp || !mage) {
/* Fehler 'Spell not found' */
cmistake(u, ord, 173, MSG_MAGIC);
return 0;