Fix für E2

Die Abfrage der Option war ohne Default, so das sie hier immer an war.
In E2 führ das dann wegen cmp_taxes zur assertion.

Das wars, jetzt sollte alles rund sein.
This commit is contained in:
CTD 2014-08-08 17:27:13 +02:00
parent fe0ff71aa1
commit 53a5314463
1 changed files with 19 additions and 20 deletions

View File

@ -1017,26 +1017,25 @@ static bool maintain(building * b, bool first)
bool paid = true, work = first; bool paid = true, work = first;
unit *u; unit *u;
if (fval(b, BLD_MAINTAINED) || b->type == NULL || b->type->maintenance == NULL if (fval(b, BLD_MAINTAINED) || b->type == NULL || b->type->maintenance == NULL || is_cursed(b->attribs, C_NOCOST, 0)) {
|| is_cursed(b->attribs, C_NOCOST, 0)) { fset(b, BLD_MAINTAINED);
fset(b, BLD_MAINTAINED); fset(b, BLD_WORKING);
fset(b, BLD_WORKING); return true;
return true; }
} if (fval(b, BLD_DONTPAY)) {
if (fval(b, BLD_DONTPAY)) { return false;
return false; }
} u = building_owner(b);
u = building_owner(b); if (u == NULL)
if (u == NULL) return false;
return false; /* If the owner is the region owner, check if biggest castle has the dontpay flag */
/* If the owner is the region owner, check if biggest castle has the dontpay flag */ if (check_param(global.parameters, "rules.region_owner_pay_building", b->type->_name)) {
if (get_param(global.parameters, "rules.region_owner_pay_building")) { if (u == building_owner(largestbuilding(r, &cmp_taxes, false))) {
if (u == building_owner(largestbuilding(r, &cmp_taxes, false))) { if (fval(u->building, BLD_DONTPAY)) {
if (fval(u->building, BLD_DONTPAY)) { return false;
return false; }
} }
} }
}
for (c = 0; b->type->maintenance[c].number; ++c) { for (c = 0; b->type->maintenance[c].number; ++c) {
const maintenance *m = b->type->maintenance + c; const maintenance *m = b->type->maintenance + c;
int need = m->number; int need = m->number;