From fe9bc734da3848635d942cedaacee2a3c271900f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 12 Feb 2008 18:51:22 +0000 Subject: [PATCH] http://eressea.upb.de/mantis/view.php?id=1366 "Doppelte Fehlermeldung" - remove error message from inner function. --- src/common/gamecode/economy.c | 46 +++++++++++++++++------------------ src/common/kernel/build.c | 1 - 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index ab965f91c..669ec26f2 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -1673,33 +1673,33 @@ split_allocations(region * r) static void create_potion(unit * u, const potion_type * ptype, int want) { - int built; + int built; if (want==0) { - want = maxbuild(u, ptype->itype->construction); + want = maxbuild(u, ptype->itype->construction); } - built = build(u, ptype->itype->construction, 0, want); - switch (built) { - case ELOWSKILL: - case ENEEDSKILL: - /* no skill, or not enough skill points to build */ - cmistake(u, u->thisorder, 50, MSG_PRODUCE); - break; - case ECOMPLETE: - assert(0); - break; - case ENOMATERIALS: - /* something missing from the list of materials */ + built = build(u, ptype->itype->construction, 0, want); + switch (built) { + case ELOWSKILL: + case ENEEDSKILL: + /* no skill, or not enough skill points to build */ + cmistake(u, u->thisorder, 50, MSG_PRODUCE); + break; + case ECOMPLETE: + assert(0); + break; + case ENOMATERIALS: + /* something missing from the list of materials */ ADDMSG(&u->faction->msgs, msg_materials_required(u, u->thisorder, ptype->itype->construction, want)); - return; - break; - default: - i_change(&u->items, ptype->itype, built); - if (want==INT_MAX) want = built; - ADDMSG(&u->faction->msgs, msg_message("manufacture", - "unit region amount wanted resource", u, u->region, built, want, ptype->itype->rtype)); - break; - } + return; + break; + default: + i_change(&u->items, ptype->itype, built); + if (want==INT_MAX) want = built; + ADDMSG(&u->faction->msgs, msg_message("manufacture", + "unit region amount wanted resource", u, u->region, built, want, ptype->itype->rtype)); + break; + } } static void diff --git a/src/common/kernel/build.c b/src/common/kernel/build.c index 182b57296..e9fb4ac78 100644 --- a/src/common/kernel/build.c +++ b/src/common/kernel/build.c @@ -798,7 +798,6 @@ maxbuild(const unit * u, const construction * cons) int have = get_pooled(u, rtype, GET_DEFAULT, INT_MAX); int need = required(1, cons->reqsize, cons->materials[c].number); if (havethisorder, 88, MSG_PRODUCE); return 0; } else maximum = min(maximum, have/need);