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