bugfix: Einheiten in Schmieden konnten auch Eisen sparen, wenn überfüllt.

This commit is contained in:
Enno Rehling 2004-04-12 10:24:01 +00:00
parent 3686c6d27a
commit 6681a76268
1 changed files with 13 additions and 2 deletions

View File

@ -683,8 +683,19 @@ build(unit * u, const construction * ctype, int completed, int want)
int have = get_pooled(u, NULL, rtype);
int prebuilt;
int canuse = have;
if (u->building)
canuse = matmod(u->building->type->attribs, u, oldresourcetype[rtype], canuse);
if (inside_building(u)) {
canuse = matmod(u->building->type->attribs, u, oldresourcetype[rtype], canuse);
#if 0
/* exploit-check */
} else if (u->building) {
int abuse = matmod(u->building->type->attribs, u, oldresourcetype[rtype], canuse);
if (abuse>canuse) {
log_printf("ABUSE: %s saves %u %s through exploit\n",
itoa36(u->faction->no), abuse-canuse,
oldresourcetype[rtype]->_name[0]);
}
#endif
}
if (canuse<0) return canuse; /* pass errors to caller */
canuse = matmod(type->attribs, u, oldresourcetype[rtype], canuse);
if (type->reqsize>1) {