"Doppelte Fehlermeldung"
- remove error message from inner function.
This commit is contained in:
Enno Rehling 2008-02-12 18:51:22 +00:00
parent 40898eea55
commit fe9bc734da
2 changed files with 23 additions and 24 deletions

View file

@ -1673,33 +1673,33 @@ split_allocations(region * r)
static void static void
create_potion(unit * u, const potion_type * ptype, int want) create_potion(unit * u, const potion_type * ptype, int want)
{ {
int built; int built;
if (want==0) { if (want==0) {
want = maxbuild(u, ptype->itype->construction); want = maxbuild(u, ptype->itype->construction);
} }
built = build(u, ptype->itype->construction, 0, want); built = build(u, ptype->itype->construction, 0, want);
switch (built) { switch (built) {
case ELOWSKILL: case ELOWSKILL:
case ENEEDSKILL: case ENEEDSKILL:
/* no skill, or not enough skill points to build */ /* no skill, or not enough skill points to build */
cmistake(u, u->thisorder, 50, MSG_PRODUCE); cmistake(u, u->thisorder, 50, MSG_PRODUCE);
break; break;
case ECOMPLETE: case ECOMPLETE:
assert(0); assert(0);
break; break;
case ENOMATERIALS: case ENOMATERIALS:
/* something missing from the list of materials */ /* something missing from the list of materials */
ADDMSG(&u->faction->msgs, msg_materials_required(u, u->thisorder, ptype->itype->construction, want)); ADDMSG(&u->faction->msgs, msg_materials_required(u, u->thisorder, ptype->itype->construction, want));
return; return;
break; break;
default: default:
i_change(&u->items, ptype->itype, built); i_change(&u->items, ptype->itype, built);
if (want==INT_MAX) want = built; if (want==INT_MAX) want = built;
ADDMSG(&u->faction->msgs, msg_message("manufacture", ADDMSG(&u->faction->msgs, msg_message("manufacture",
"unit region amount wanted resource", u, u->region, built, want, ptype->itype->rtype)); "unit region amount wanted resource", u, u->region, built, want, ptype->itype->rtype));
break; break;
} }
} }
static void static void

View file

@ -798,7 +798,6 @@ maxbuild(const unit * u, const construction * cons)
int have = get_pooled(u, rtype, GET_DEFAULT, INT_MAX); int have = get_pooled(u, rtype, GET_DEFAULT, INT_MAX);
int need = required(1, cons->reqsize, cons->materials[c].number); int need = required(1, cons->reqsize, cons->materials[c].number);
if (have<need) { if (have<need) {
cmistake(u, u->thisorder, 88, MSG_PRODUCE);
return 0; return 0;
} }
else maximum = min(maximum, have/need); else maximum = min(maximum, have/need);