"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
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

View file

@ -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 (have<need) {
cmistake(u, u->thisorder, 88, MSG_PRODUCE);
return 0;
}
else maximum = min(maximum, have/need);