forked from github/server
Kampf auf See war kaputt.
This commit is contained in:
parent
060d7e2fd6
commit
a1d59b99cb
|
@ -3609,9 +3609,9 @@ bool long_order_allowed(const unit *u, bool flags_only)
|
|||
*/
|
||||
return false;
|
||||
}
|
||||
if (flags_only) return true;
|
||||
if (fval(r->terrain, SEA_REGION) && !(u_race(u)->flags & RCF_SWIM)) {
|
||||
if (flags_only) return false;
|
||||
else if (u_race(u) != get_race(RC_AQUARIAN)) {
|
||||
if (u_race(u) != get_race(RC_AQUARIAN)) {
|
||||
/* error message disabled by popular demand */
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1908,6 +1908,7 @@ static void test_long_order_on_ocean(CuTest *tc) {
|
|||
test_setup();
|
||||
rc = test_create_race("pikachu");
|
||||
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));
|
||||
rc->flags |= RCF_SWIM;
|
||||
CuAssertTrue(tc, long_order_allowed(u, false));
|
||||
|
@ -1918,11 +1919,10 @@ static void test_long_order_on_ocean(CuTest *tc) {
|
|||
rc = test_create_race("aquarian");
|
||||
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, true));
|
||||
CuAssertTrue(tc, long_order_allowed(u, true));
|
||||
u->faction->flags |= FFL_PAUSED;
|
||||
CuAssertTrue(tc, !long_order_allowed(u, true));
|
||||
CuAssertTrue(tc, !long_order_allowed(u, false));
|
||||
u->faction->flags -= FFL_PAUSED;
|
||||
test_teardown();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue