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