forked from github/server
disallow building other people's castles
This commit is contained in:
parent
39b5ad5b1a
commit
7175c87140
|
@ -827,6 +827,7 @@ build_building(unit * u, const building_type * btype, int want, order * ord)
|
||||||
const char * btname;
|
const char * btname;
|
||||||
order * new_order = NULL;
|
order * new_order = NULL;
|
||||||
const struct locale * lang = u->faction->locale;
|
const struct locale * lang = u->faction->locale;
|
||||||
|
static int rule_other = -1;
|
||||||
|
|
||||||
assert(u->number);
|
assert(u->number);
|
||||||
if (eff_skill(u, SK_BUILDING, r) == 0) {
|
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;
|
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 (b) built = b->size;
|
||||||
if (n<=0 || n == INT_MAX) {
|
if (n<=0 || n == INT_MAX) {
|
||||||
|
|
|
@ -160,6 +160,7 @@
|
||||||
<param name="rules.magic.common" value="tybied"/> <!-- tybied spells can be cast by anyone -->
|
<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.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.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.taxation" value="1"/>
|
||||||
<param name="rules.economy.food" value="2"/>
|
<param name="rules.economy.food" value="2"/>
|
||||||
<param name="rules.economy.wages" value="1"/>
|
<param name="rules.economy.wages" value="1"/>
|
||||||
|
|
Loading…
Reference in New Issue