From 489cb20b624e3bd2891faffd5b9c93b852888fa7 Mon Sep 17 00:00:00 2001 From: Katja Zedel Date: Thu, 21 Feb 2002 07:36:34 +0000 Subject: [PATCH] =?UTF-8?q?fix=20STIRB=20item=20=C3=BCbergabe=20funktionie?= =?UTF-8?q?rt=20nun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/gamecode/laws.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 2ffbab5dc..b92e85b9e 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -136,14 +136,17 @@ destroyfaction(faction * f) while (nf) { unit * u2 = nf->unit; #ifdef NEW_ITEMS - const item * itm; - for (itm=u->items;itm;itm=itm->next) { + item * itm = u->items; + while(itm){ + const item_type * itype = itm->type; + item * itn = itm->next; int n = itm->number; - if (n<=0) continue; n = n * nf->number / number; - if (n<=0) continue; - i_change(&u->items, itm->type, -n); - i_change(&u2->items, itm->type, n); + if (n>0) { + i_change(&u->items, itype, -n); + i_change(&u2->items, itype, n); + } + itm = itn; } #else resource_t res;