disallow building other people's castles

This commit is contained in:
Enno Rehling 2009-08-04 15:29:07 +00:00
parent 39b5ad5b1a
commit 7175c87140
2 changed files with 12 additions and 0 deletions

View File

@ -827,6 +827,7 @@ build_building(unit * u, const building_type * btype, int want, order * ord)
const char * btname;
order * new_order = NULL;
const struct locale * lang = u->faction->locale;
static int rule_other = -1;
assert(u->number);
if (eff_skill(u, SK_BUILDING, r) == 0) {
@ -881,6 +882,16 @@ build_building(unit * u, const building_type * btype, int want, order * ord)
}
n = 1;
}
if (rule_other<0) {
rule_other = get_param_int(global.parameters, "rules.build.other_buildings", 1);
}
if (!rule_other) {
unit * owner = buildingowner(r, b);
if (!owner || owner->faction!=u->faction) {
cmistake(u, ord, 1222, MSG_PRODUCE);
return;
}
}
if (b) built = b->size;
if (n<=0 || n == INT_MAX) {

View File

@ -160,6 +160,7 @@
<param name="rules.magic.common" value="tybied"/> <!-- tybied spells can be cast by anyone -->
<param name="rules.magic.elfpower" value="1"/> <!-- elves get ring-of-power bonus in a forest -->
<param name="rules.magic.playerschools" value="gwyrrd illaun draig cerddor"/>
<param name="rules.build.other_buildings" value="0"/>
<param name="rules.economy.taxation" value="1"/>
<param name="rules.economy.food" value="2"/>
<param name="rules.economy.wages" value="1"/>