From ae31948dc5db8d08ac47cd64d5d3a773ab5ec672 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 16 Apr 2012 06:56:44 +0200 Subject: [PATCH] fix a crash when wolves are cast with too little force --- src/gamecode/economy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gamecode/economy.c b/src/gamecode/economy.c index 4097b055f..dd417fcf4 100644 --- a/src/gamecode/economy.c +++ b/src/gamecode/economy.c @@ -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