forked from github/server
fix a crash when wolves are cast with too little force
This commit is contained in:
parent
80a907d78f
commit
ae31948dc5
1 changed files with 4 additions and 1 deletions
|
@ -510,9 +510,12 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders)
|
||||||
if (recruitcost < 0) {
|
if (recruitcost < 0) {
|
||||||
rc = u->race;
|
rc = u->race;
|
||||||
recruitcost = recruit_cost(f, rc);
|
recruitcost = recruit_cost(f, rc);
|
||||||
|
if (recruitcost < 0) {
|
||||||
|
recruitcost = INT_MAX;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
assert(rc);
|
||||||
u->race = rc;
|
u->race = rc;
|
||||||
assert(rc && recruitcost >= 0);
|
|
||||||
|
|
||||||
#if GUARD_DISABLES_RECRUIT
|
#if GUARD_DISABLES_RECRUIT
|
||||||
/* this is a very special case because the recruiting unit may be empty
|
/* this is a very special case because the recruiting unit may be empty
|
||||||
|
|
Loading…
Reference in a new issue