diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index b73dc2fba..f91686774 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -1556,7 +1556,7 @@ display_cmd(unit * u, struct order * ord) cmistake(u, ord, 148, MSG_EVENT); break; } - if (b != largestbuilding(r, &cmp_current_owner, false)) { + if (b != largestbuilding(r, rule_region_owners()?&cmp_current_owner:&cmp_wage, false)) { cmistake(u, ord, 147, MSG_EVENT); break; } @@ -1800,7 +1800,8 @@ name_cmd(unit * u, struct order * ord) cmistake(u, ord, 148, MSG_EVENT); break; } - if (b != largestbuilding(r, &cmp_current_owner, false)) { + + if (b != largestbuilding(r, rule_region_owners()?&cmp_current_owner:&cmp_wage, false)) { cmistake(u, ord, 147, MSG_EVENT); break; } diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 308868523..3843dda0d 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -2677,6 +2677,8 @@ int cmp_current_owner(const building * b, const building * a) { faction * f = region_get_owner(b->region); + + assert(rule_region_owners()); if (f && b->type->taxes) { unit * u = buildingowner(b->region, b); if (!u || u->faction!=f) return -1; @@ -2696,10 +2698,21 @@ cmp_current_owner(const building * b, const building * a) return -1; } +int rule_region_owners(void) +{ + static int rule_owners = -1; + if (rule_owners<0) { + rule_owners = get_param_int(global.parameters, "rules.region_owners", 0); + } + return rule_owners; +} + int rule_auto_taxation(void) { static int rule_taxation = -1; - rule_taxation = get_param_int(global.parameters, "rules.economy.taxation", TAX_ORDER); + if (rule_taxation<0) { + rule_taxation = get_param_int(global.parameters, "rules.economy.taxation", TAX_ORDER); + } return rule_taxation; } diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index 381ad5c75..ae0a8421a 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -252,6 +252,7 @@ int cmp_current_owner(const struct building * b, const struct building * bother) #define TAX_ORDER 0x00 #define TAX_OWNER 0x01 int rule_auto_taxation(void); +int rule_region_owners(void); extern int count_all(const struct faction * f); extern int count_migrants (const struct faction * f); diff --git a/src/common/kernel/move.c b/src/common/kernel/move.c index 4dbdaf297..aa96a4250 100644 --- a/src/common/kernel/move.c +++ b/src/common/kernel/move.c @@ -901,7 +901,7 @@ is_guardian_r(const unit * guard) { if (guard->number == 0) return false; if (besieged(guard)) return false; - if (guard->building && fval(guard, UFL_OWNER)) { + if (guard->building && rule_region_owners() && fval(guard, UFL_OWNER)) { faction * owner = region_get_owner(guard->region); if (owner==guard->faction) { building * bowner = largestbuilding(guard->region, &cmp_taxes, false); diff --git a/src/common/kernel/region.c b/src/common/kernel/region.c index 20c5f57df..0930ff788 100644 --- a/src/common/kernel/region.c +++ b/src/common/kernel/region.c @@ -1447,6 +1447,7 @@ r_addmessage(struct region * r, const struct faction * viewer, struct message * struct faction * region_get_owner(const struct region * r) { + assert(rule_region_owners()); if (r->land && r->land->ownership) { return r->land->ownership->owner; } @@ -1456,6 +1457,7 @@ region_get_owner(const struct region * r) void region_set_owner(struct region * r, struct faction * owner, int turn) { + assert(rule_region_owners()); if (r->land) { if (!r->land->ownership) { r->land->ownership = malloc(sizeof(region_owner)); @@ -1478,6 +1480,7 @@ region_set_owner(struct region * r, struct faction * owner, int turn) faction * update_owners(region * r) { faction * f = NULL; + assert(rule_region_owners()); if (r->land) { building * bowner = largestbuilding(r, &cmp_current_owner, false); building * blargest = largestbuilding(r, &cmp_taxes, false); diff --git a/src/res/e3a.xml b/src/res/e3a.xml index 5de89aaaa..1b577cb30 100644 --- a/src/res/e3a.xml +++ b/src/res/e3a.xml @@ -151,6 +151,7 @@ +