forked from github/server
do_combatspell didn't check that the unit was a mage.
This commit is contained in:
parent
30cf9e2659
commit
7d7842b849
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue