From 4d173cf7e2232304ab815600dd4ef08f98813353 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 6 Jul 2014 12:39:03 -0700 Subject: [PATCH] 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 --- src/economy.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/economy.c b/src/economy.c index 0f1a7874e..2ac2a1e1c 100644 --- a/src/economy.c +++ b/src/economy.c @@ -372,13 +372,19 @@ static int do_recruiting(recruitment * recruits, int available) use_pooled(u, get_resourcetype(R_SILVER), GET_DEFAULT, rc->recruitcost * number); } - add_recruits(u, number, req->qty); - dec = (int)(number * multi); - if ((rc->ec_flags & ECF_REC_ETHEREAL) == 0) { - recruited += dec; + if (u->number == 0 && !fval(u, UFL_ISNEW)) { + /* unit is empty, and not a TEMP => it is dead, and cannot recruit */ + number = 0; } + 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;