forked from github/server
newterrain sucks.
This commit is contained in:
parent
440679da87
commit
96ff0815c4
2 changed files with 13 additions and 16 deletions
|
@ -1590,17 +1590,10 @@ static void buy(unit * u, request ** buyorders, struct order *ord)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u_race(u) == get_race(RC_INSECT)) {
|
/* Entweder man ist Insekt in Sumpf/Wueste, oder es muss
|
||||||
/* entweder man ist insekt, oder... */
|
* einen Handelsposten in der Region geben: */
|
||||||
if (r->terrain != newterrain(T_SWAMP) && r->terrain != newterrain(T_DESERT)
|
if (u_race(u) != get_race(RC_INSECT) || (r->terrain == newterrain(T_SWAMP) || r->terrain == newterrain(T_DESERT))) {
|
||||||
&& !rbuildings(r)) {
|
building *b = NULL;
|
||||||
cmistake(u, ord, 119, MSG_COMMERCE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* ...oder in der Region mu<6D> es eine Burg geben. */
|
|
||||||
building *b = 0;
|
|
||||||
if (r->buildings) {
|
if (r->buildings) {
|
||||||
static int cache;
|
static int cache;
|
||||||
static const struct building_type *bt_castle;
|
static const struct building_type *bt_castle;
|
||||||
|
|
|
@ -181,7 +181,9 @@ static void setup_terrains(CuTest *tc) {
|
||||||
test_create_terrain("ocean", SEA_REGION | SWIM_INTO | FLY_INTO);
|
test_create_terrain("ocean", SEA_REGION | SWIM_INTO | FLY_INTO);
|
||||||
test_create_terrain("swamp", LAND_REGION | WALK_INTO | FLY_INTO);
|
test_create_terrain("swamp", LAND_REGION | WALK_INTO | FLY_INTO);
|
||||||
test_create_terrain("desert", LAND_REGION | WALK_INTO | FLY_INTO);
|
test_create_terrain("desert", LAND_REGION | WALK_INTO | FLY_INTO);
|
||||||
|
test_create_terrain("mountain", LAND_REGION | WALK_INTO | FLY_INTO);
|
||||||
init_terrains();
|
init_terrains();
|
||||||
|
CuAssertPtrNotNull(tc, newterrain(T_MOUNTAIN));
|
||||||
CuAssertPtrNotNull(tc, newterrain(T_OCEAN));
|
CuAssertPtrNotNull(tc, newterrain(T_OCEAN));
|
||||||
CuAssertPtrNotNull(tc, newterrain(T_PLAIN));
|
CuAssertPtrNotNull(tc, newterrain(T_PLAIN));
|
||||||
CuAssertPtrNotNull(tc, newterrain(T_SWAMP));
|
CuAssertPtrNotNull(tc, newterrain(T_SWAMP));
|
||||||
|
@ -225,7 +227,7 @@ static void test_trade_insect(CuTest *tc) {
|
||||||
init_resources();
|
init_resources();
|
||||||
test_create_locale();
|
test_create_locale();
|
||||||
setup_terrains(tc);
|
setup_terrains(tc);
|
||||||
r = setup_trade_region(tc, test_create_terrain("swamp", LAND_REGION));
|
r = setup_trade_region(tc, get_terrain("swamp"));
|
||||||
init_terrains();
|
init_terrains();
|
||||||
|
|
||||||
it_luxury = r_luxury(r);
|
it_luxury = r_luxury(r);
|
||||||
|
@ -240,6 +242,8 @@ static void test_trade_insect(CuTest *tc) {
|
||||||
produce(u->region);
|
produce(u->region);
|
||||||
CuAssertIntEquals(tc, 1, get_item(u, it_luxury));
|
CuAssertIntEquals(tc, 1, get_item(u, it_luxury));
|
||||||
CuAssertIntEquals(tc, 5, get_item(u, it_silver));
|
CuAssertIntEquals(tc, 5, get_item(u, it_silver));
|
||||||
|
|
||||||
|
terraform_region(r, get_terrain("swamp"));
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue