forked from github/server
BESCHREIBE REGION ist jeder Einheit des Regionsbesitzers erlaubt
This commit is contained in:
parent
77cbd04cfa
commit
30fc6f3e91
20
src/laws.c
20
src/laws.c
|
@ -1538,16 +1538,6 @@ int prefix_cmd(unit * u, struct order *ord)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cmp_building_cb get_cmp_region_owner(void)
|
|
||||||
{
|
|
||||||
if (rule_region_owners()) {
|
|
||||||
return &cmp_current_owner;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return &cmp_wage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int display_cmd(unit * u, struct order *ord)
|
int display_cmd(unit * u, struct order *ord)
|
||||||
{
|
{
|
||||||
char token[128];
|
char token[128];
|
||||||
|
@ -1597,15 +1587,7 @@ int display_cmd(unit * u, struct order *ord)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case P_REGION:
|
case P_REGION:
|
||||||
if (!u->building) {
|
if (u->faction != region_get_owner(r)) {
|
||||||
cmistake(u, ord, 145, MSG_EVENT);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (building_owner(u->building) != u) {
|
|
||||||
cmistake(u, ord, 148, MSG_EVENT);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (u->building != largestbuilding(r, get_cmp_region_owner(), false)) {
|
|
||||||
cmistake(u, ord, 147, MSG_EVENT);
|
cmistake(u, ord, 147, MSG_EVENT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,6 +229,11 @@ static void test_display_cmd(CuTest *tc) {
|
||||||
CuAssertPtrEquals(tc, NULL, u->display);
|
CuAssertPtrEquals(tc, NULL, u->display);
|
||||||
free_order(ord);
|
free_order(ord);
|
||||||
|
|
||||||
|
ord = create_order(K_DISPLAY, f->locale, "%s Hodor", LOC(f->locale, parameters[P_REGION]));
|
||||||
|
CuAssertIntEquals(tc, 0, display_cmd(u, ord));
|
||||||
|
CuAssertPtrEquals(tc, NULL, r->display);
|
||||||
|
free_order(ord);
|
||||||
|
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue