do_combatspell didn't check that the unit was a mage.

This commit is contained in:
Enno Rehling 2021-05-03 20:15:23 +02:00
parent 30cf9e2659
commit 7d7842b849
1 changed files with 5 additions and 1 deletions

View File

@ -1781,8 +1781,12 @@ static void do_combatspell(troop at)
int fumblechance = 0; int fumblechance = 0;
struct sc_mage *mage = get_mage(u); struct sc_mage *mage = get_mage(u);
if (!mage) {
fi->magic = 0; /* Hat keinen Kampfzauber, kaempft nichtmagisch weiter */
return;
}
sp = mage_get_combatspell(mage, 1, &sl); sp = mage_get_combatspell(mage, 1, &sl);
if (sl <= 0 || sp == NULL || !u_hasspell(u, sp)) { if (sp == NULL || sl <= 0 || !u_hasspell(u, sp)) {
fi->magic = 0; /* Hat keinen Kampfzauber, kaempft nichtmagisch weiter */ fi->magic = 0; /* Hat keinen Kampfzauber, kaempft nichtmagisch weiter */
return; return;
} }