From f530f30cb70e9bc323caff560d08d063f5c1ead0 Mon Sep 17 00:00:00 2001 From: Christian Schlittchen Date: Sat, 27 Apr 2002 17:57:38 +0000 Subject: [PATCH] - Munitionsverbraucht beim Belagern --- src/common/items/weapons.c | 4 ++-- src/common/kernel/build.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/items/weapons.c b/src/common/items/weapons.c index 91129bf24..ad73e75a7 100644 --- a/src/common/items/weapons.c +++ b/src/common/items/weapons.c @@ -215,7 +215,7 @@ attack_catapult(const troop * at, int * casualties, int row) assert(af->person[at->index].reload==0); #if CATAPULT_AMMUNITION - if(new_get_pooled(au, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK|GET_POOLED_RESERVE|GET_POOLED_FORCE) <= 0) { + if(new_get_pooled(au, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK) <= 0) { /* No ammo. Use other weapon if available. */ return true; } @@ -236,7 +236,7 @@ attack_catapult(const troop * at, int * casualties, int row) n = min(CATAPULT_ATTACKS, count_enemies(b, af->side, FS_ENEMY, minrow, maxrow)); #if CATAPULT_AMMUNITION - new_use_pooled(au, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK|GET_POOLED_RESERVE|GET_POOLED_FORCE, 1); + new_use_pooled(au, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK, 1); #endif while (--n >= 0) { diff --git a/src/common/kernel/build.c b/src/common/kernel/build.c index a4ccb423e..f649cdde4 100644 --- a/src/common/kernel/build.c +++ b/src/common/kernel/build.c @@ -197,7 +197,8 @@ siege(region * r, unit * u) } /* schaden durch katapulte */ - d = min(u->number, get_item(u, I_CATAPULT)); + d = min(u->number, + min(new_get_pooled(u, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK), get_item(u, I_CATAPULT))); if (eff_skill(u, SK_CATAPULT, r) >= 1) { katapultiere = d; d *= eff_skill(u, SK_CATAPULT, r); @@ -205,7 +206,6 @@ siege(region * r, unit * u) d = 0; } - if ((bewaffnete = armedmen(u)) == 0 && d == 0) { /* abbruch, falls unbewaffnet oder unfaehig, katapulte zu benutzen */ cmistake(u, findorder(u, u->thisorder), 80, MSG_EVENT); @@ -232,6 +232,7 @@ siege(region * r, unit * u) /* meldung, schaden anrichten */ if (d && !(is_cursed(b->attribs, C_MAGICSTONE, 0))) { b->size -= d; + new_use_pooled(au, &rt_catapultammo, GET_SLACK|GET_RESERVE|GET_POOLED_SLACK, d); d = 100 * d / b->size; } else d = 0;