E2 fähig gemacht

Der Burgenbesitzer sieht nur noch etwas wenn er auch Leuchtturmbesitzer
ist.
Das geht jetzt auch für E2 ohne region_owner rule.
This commit is contained in:
CTD 2014-08-08 17:15:12 +02:00
parent 90cf6d845f
commit fe0ff71aa1
3 changed files with 11 additions and 5 deletions

View File

@ -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)) { if (!heir && check_param(global.parameters, "rules.region_owner_pay_building", bld->type->_name)) {
if (rule_region_owners()) {
u = building_owner(largestbuilding(bld->region, &cmp_taxes, false)); u = building_owner(largestbuilding(bld->region, &cmp_taxes, false));
}
else {
u = building_owner(largestbuilding(bld->region, &cmp_wage, false));
}
if (u) { if (u) {
heir = u; heir = u;
} }

View File

@ -1538,8 +1538,10 @@ int lighthouse_range(const building * b, const faction * f)
int c = 0; int c = 0;
unit *u; unit *u;
for (u = r->units; u; u = u->next) { for (u = r->units; u; u = u->next) {
if (u->building == b || u == building_owner(b)) {
if (u->building == b) { if (u->building == b) {
c += u->number; c += u->number;
}
if (c > buildingcapacity(b)) if (c > buildingcapacity(b))
break; break;
if (f == NULL || u->faction == f) { if (f == NULL || u->faction == f) {

View File

@ -1526,8 +1526,7 @@ static void prepare_reports(void)
if (check_param(global.parameters, "rules.region_owner_pay_building", bt_lighthouse->_name)) { if (check_param(global.parameters, "rules.region_owner_pay_building", bt_lighthouse->_name)) {
for (b = rbuildings(r); b; b = b->next) { for (b = rbuildings(r); b; b = b->next) {
if (b && b->type == bt_lighthouse) { if (b && b->type == bt_lighthouse) {
u = building_owner(largestbuilding(r, &cmp_taxes, false)); u = building_owner(b);
/* alternativ: u = building_owner(b); if not all region owners should see */
if (u) { if (u) {
prepare_lighthouse(b, u->faction); prepare_lighthouse(b, u->faction);
if (u_race(u) != get_race(RC_SPELL) || u->number == RS_FARVISION) { if (u_race(u) != get_race(RC_SPELL) || u->number == RS_FARVISION) {