fix a crash when wolves are cast with too little force

This commit is contained in:
Enno Rehling 2012-04-16 06:56:44 +02:00
parent 80a907d78f
commit ae31948dc5
1 changed files with 4 additions and 1 deletions

View File

@ -510,9 +510,12 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders)
if (recruitcost < 0) {
rc = u->race;
recruitcost = recruit_cost(f, rc);
if (recruitcost < 0) {
recruitcost = INT_MAX;
}
}
assert(rc);
u->race = rc;
assert(rc && recruitcost >= 0);
#if GUARD_DISABLES_RECRUIT
/* this is a very special case because the recruiting unit may be empty