From 376d38e787c631a485269b61365e08ebb1c49351 Mon Sep 17 00:00:00 2001 From: Katja Zedel Date: Tue, 19 Feb 2002 20:41:20 +0000 Subject: [PATCH] =?UTF-8?q?STIRB=20angepasst.=20Zentauren=20gehen=20an=20P?= =?UTF-8?q?ferde,=20Orks=20z=C3=A4hlen=20nur=20die=20H=C3=A4lfte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/gamecode/laws.c | 42 ++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index cfdc14d5b..2ffbab5dc 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -134,8 +134,19 @@ destroyfaction(faction * f) if (friends && number) { struct friend * nf = friends; while (nf) { - resource_t res; unit * u2 = nf->unit; +#ifdef NEW_ITEMS + const item * itm; + for (itm=u->items;itm;itm=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); + } +#else + resource_t res; for (res = 0; res <= R_SILVER; ++res) { int n = get_resource(u, res); if (n<=0) continue; @@ -144,24 +155,37 @@ destroyfaction(faction * f) change_resource(u, res, -n); change_resource(u2, res, n); } +#endif number -= nf->number; nf = nf->next; free(friends); friends = nf; } friends = NULL; - } else { - int p = rpeasants(u->region), - m = rmoney(u->region), - h = rhorses(u->region); - if (rterrain(r) != T_OCEAN && !!playerrace(u->race)) { - p += u->number; - m += get_money(u); - h += get_item(u, I_HORSE); + } + if (rterrain(r) != T_OCEAN && !!playerrace(u->race)) { + const race * rc = u->race; + int p = rpeasants(u->region); + int m = rmoney(u->region); + int h = rhorses(u->region); + + /* Personen gehen nur an die Bauern, wenn sie auch von dort + * stammen */ + if ((rc->ec_flags & ECF_REC_UNLIMITED)==0) { + if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */ + h += u->number; + } else if (rc == new_race[RC_URUK]){ /* Orks zählen nur zur Hälfte */ + p += u->number/2; + } else { + p += u->number; + } } + m += get_money(u); + h += get_item(u, I_HORSE); rsetpeasants(r, p); rsethorses(r, h); rsetmoney(r, m); + } set_number(u, 0); }