forked from github/server
Merge branch 'master' into develop
This commit is contained in:
commit
6244c6c437
|
@ -3609,9 +3609,9 @@ bool long_order_allowed(const unit *u, bool flags_only)
|
||||||
*/
|
*/
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (flags_only) return true;
|
||||||
if (fval(r->terrain, SEA_REGION) && !(u_race(u)->flags & RCF_SWIM)) {
|
if (fval(r->terrain, SEA_REGION) && !(u_race(u)->flags & RCF_SWIM)) {
|
||||||
if (flags_only) return false;
|
if (u_race(u) != get_race(RC_AQUARIAN)) {
|
||||||
else if (u_race(u) != get_race(RC_AQUARIAN)) {
|
|
||||||
/* error message disabled by popular demand */
|
/* error message disabled by popular demand */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1997,6 +1997,7 @@ static void test_long_order_on_ocean(CuTest *tc) {
|
||||||
test_setup();
|
test_setup();
|
||||||
rc = test_create_race("pikachu");
|
rc = test_create_race("pikachu");
|
||||||
u = test_create_unit(test_create_faction_ex(rc, NULL), test_create_ocean(0, 0));
|
u = test_create_unit(test_create_faction_ex(rc, NULL), test_create_ocean(0, 0));
|
||||||
|
CuAssertTrue(tc, long_order_allowed(u, true));
|
||||||
CuAssertTrue(tc, !long_order_allowed(u, false));
|
CuAssertTrue(tc, !long_order_allowed(u, false));
|
||||||
rc->flags |= RCF_SWIM;
|
rc->flags |= RCF_SWIM;
|
||||||
CuAssertTrue(tc, long_order_allowed(u, false));
|
CuAssertTrue(tc, long_order_allowed(u, false));
|
||||||
|
@ -2007,11 +2008,10 @@ static void test_long_order_on_ocean(CuTest *tc) {
|
||||||
rc = test_create_race("aquarian");
|
rc = test_create_race("aquarian");
|
||||||
u = test_create_unit(test_create_faction_ex(rc, NULL), u->region);
|
u = test_create_unit(test_create_faction_ex(rc, NULL), u->region);
|
||||||
CuAssertTrue(tc, long_order_allowed(u, false));
|
CuAssertTrue(tc, long_order_allowed(u, false));
|
||||||
CuAssertTrue(tc, !long_order_allowed(u, true));
|
CuAssertTrue(tc, long_order_allowed(u, true));
|
||||||
u->faction->flags |= FFL_PAUSED;
|
u->faction->flags |= FFL_PAUSED;
|
||||||
CuAssertTrue(tc, !long_order_allowed(u, true));
|
CuAssertTrue(tc, !long_order_allowed(u, true));
|
||||||
CuAssertTrue(tc, !long_order_allowed(u, false));
|
CuAssertTrue(tc, !long_order_allowed(u, false));
|
||||||
u->faction->flags -= FFL_PAUSED;
|
|
||||||
test_teardown();
|
test_teardown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue