fix a crash where wolves have not enough firce

This commit is contained in:
Enno Rehling 2012-04-16 06:58:03 +02:00
parent c070d999a3
commit 03f74f0a47
1 changed files with 21 additions and 19 deletions

View File

@ -795,8 +795,10 @@ int sp_wolfhowl(fighter * fi, int level, double power, spell * sp)
attrib *a;
message *msg;
int force = (int)(get_force(power, 3) / 2);
const race * rc = new_race[RC_WOLF];
if (force>0) {
unit *u =
create_unit(r, mage->faction, force, new_race[RC_WOLF], 0, NULL, mage);
create_unit(r, mage->faction, force, rc, 0, NULL, mage);
unused(sp);
leave(u, true);
@ -816,9 +818,9 @@ int sp_wolfhowl(fighter * fi, int level, double power, spell * sp)
a_add(&u->attribs, a);
make_fighter(b, u, fi->side, is_attacker(fi));
}
msg =
msg_message("sp_wolfhowl_effect", "mage amount race", mage, u->number,
u->race);
msg_message("sp_wolfhowl_effect", "mage amount race", mage, force, rc);
message_all(b, msg);
msg_release(msg);