forked from github/server
if a unit is empty, and not a TEMP, then it is dead and cannot recruit.
This fixes http://bugs.eressea.de/view.php?id=2010
This commit is contained in:
parent
9e2e7bfe97
commit
4d173cf7e2
|
@ -372,13 +372,19 @@ static int do_recruiting(recruitment * recruits, int available)
|
||||||
use_pooled(u, get_resourcetype(R_SILVER), GET_DEFAULT,
|
use_pooled(u, get_resourcetype(R_SILVER), GET_DEFAULT,
|
||||||
rc->recruitcost * number);
|
rc->recruitcost * number);
|
||||||
}
|
}
|
||||||
add_recruits(u, number, req->qty);
|
if (u->number == 0 && !fval(u, UFL_ISNEW)) {
|
||||||
dec = (int)(number * multi);
|
/* unit is empty, and not a TEMP => it is dead, and cannot recruit */
|
||||||
if ((rc->ec_flags & ECF_REC_ETHEREAL) == 0) {
|
number = 0;
|
||||||
recruited += dec;
|
|
||||||
}
|
}
|
||||||
|
if (number > 0) {
|
||||||
|
add_recruits(u, number, req->qty);
|
||||||
|
dec = (int)(number * multi);
|
||||||
|
if ((rc->ec_flags & ECF_REC_ETHEREAL) == 0) {
|
||||||
|
recruited += dec;
|
||||||
|
}
|
||||||
|
|
||||||
get -= dec;
|
get -= dec;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return recruited;
|
return recruited;
|
||||||
|
|
Loading…
Reference in New Issue