From fe0ff71aa1cd77e590a3ffb2027405c8ee1c7715 Mon Sep 17 00:00:00 2001 From: CTD Date: Fri, 8 Aug 2014 17:15:12 +0200 Subject: [PATCH] =?UTF-8?q?E2=20f=C3=A4hig=20gemacht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Der Burgenbesitzer sieht nur noch etwas wenn er auch Leuchtturmbesitzer ist. Das geht jetzt auch für E2 ohne region_owner rule. --- src/kernel/building.c | 7 ++++++- src/kernel/config.c | 6 ++++-- src/kernel/reports.c | 3 +-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/kernel/building.c b/src/kernel/building.c index 67e50a975..298c5603e 100644 --- a/src/kernel/building.c +++ b/src/kernel/building.c @@ -670,7 +670,12 @@ static unit *building_owner_ex(const building * bld, const struct faction * last } } if (!heir && check_param(global.parameters, "rules.region_owner_pay_building", bld->type->_name)) { - u = building_owner(largestbuilding(bld->region, &cmp_taxes, false)); + if (rule_region_owners()) { + u = building_owner(largestbuilding(bld->region, &cmp_taxes, false)); + } + else { + u = building_owner(largestbuilding(bld->region, &cmp_wage, false)); + } if (u) { heir = u; } diff --git a/src/kernel/config.c b/src/kernel/config.c index 2295e0f28..51fe78349 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -1538,8 +1538,10 @@ int lighthouse_range(const building * b, const faction * f) int c = 0; unit *u; for (u = r->units; u; u = u->next) { - if (u->building == b) { - c += u->number; + if (u->building == b || u == building_owner(b)) { + if (u->building == b) { + c += u->number; + } if (c > buildingcapacity(b)) break; if (f == NULL || u->faction == f) { diff --git a/src/kernel/reports.c b/src/kernel/reports.c index 454dbf3c0..a3c075b40 100644 --- a/src/kernel/reports.c +++ b/src/kernel/reports.c @@ -1526,8 +1526,7 @@ static void prepare_reports(void) if (check_param(global.parameters, "rules.region_owner_pay_building", bt_lighthouse->_name)) { for (b = rbuildings(r); b; b = b->next) { if (b && b->type == bt_lighthouse) { - u = building_owner(largestbuilding(r, &cmp_taxes, false)); - /* alternativ: u = building_owner(b); if not all region owners should see */ + u = building_owner(b); if (u) { prepare_lighthouse(b, u->faction); if (u_race(u) != get_race(RC_SPELL) || u->number == RS_FARVISION) {