From 99a5f4d525825c9e5476ee3e1e2723b2bb67e8dd Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 3 Oct 2006 13:31:48 +0000 Subject: [PATCH] implementation of "EACH": RESERVE EACH 1 sword RESERVIERE JE[DEM] 1 schwert --- src/common/kernel/pool.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/kernel/pool.c b/src/common/kernel/pool.c index c0bbd9da5..a91be0e66 100644 --- a/src/common/kernel/pool.c +++ b/src/common/kernel/pool.c @@ -264,12 +264,18 @@ int reserve_cmd(unit * u, struct order *ord) { if (u->number > 0 && (urace(u)->ec_flags & GETITEM)) { - int use, count = geti(); + int use, count; const resource_type * rtype; + const char * s; init_tokens(ord); skip_token(); - count = geti(); + s = getstrtoken(); + count = atoip(s); + + if (count == 0 && findparam(s, u->faction->locale)==P_EACH) { + count = u->number; + } rtype = findresourcetype(getstrtoken(), u->faction->locale); if (rtype == NULL) return 0;