diff --git a/src/kernel/build.c b/src/kernel/build.c index 6fb17c859..0763cbe16 100644 --- a/src/kernel/build.c +++ b/src/kernel/build.c @@ -769,7 +769,7 @@ build_building(unit * u, const building_type * btype, int id, int want, order * /* build a new building */ b = new_building(btype, r, lang); b->type = btype; - fset(b, BLD_MAINTAINED); + fset(b, BLD_MAINTAINED|BLD_WORKING); /* Die Einheit befindet sich automatisch im Inneren der neuen Burg. */ if (u->number && leave(u, false)) { diff --git a/src/kernel/building.c b/src/kernel/building.c index f56c49fb7..2aa1a0b1a 100644 --- a/src/kernel/building.c +++ b/src/kernel/building.c @@ -486,7 +486,6 @@ building *new_building(const struct building_type * btype, region * r, init_lighthouse = true; } - b->flags = BLD_WORKING | BLD_MAINTAINED; b->no = newcontainerid(); bhash(b); diff --git a/src/kernel/move.test.c b/src/kernel/move.test.c index 5e1d0ecae..100d4fc30 100644 --- a/src/kernel/move.test.c +++ b/src/kernel/move.test.c @@ -43,6 +43,7 @@ static void test_ship_allowed_with_harbor(CuTest * tc) ship * sh; terrain_type * ttype; building_type * btype; + building * b; test_cleanup(); test_create_world(); @@ -53,7 +54,8 @@ static void test_ship_allowed_with_harbor(CuTest * tc) r = test_create_region(0, 0, ttype); sh = test_create_ship(0, 0); - test_create_building(r, btype); + b = test_create_building(r, btype); + b->flags |= BLD_WORKING; CuAssertIntEquals(tc, SA_HARBOUR, check_ship_allowed(sh, r)); } @@ -73,9 +75,9 @@ static void test_building_type_exists(CuTest * tc) b = new_building(btype, r, default_locale); CuAssertPtrNotNull(tc, b); - CuAssertTrue(tc, !buildingtype_exists(r, NULL, true)); - CuAssertTrue(tc, buildingtype_exists(r, btype, true)); - CuAssertTrue(tc, !buildingtype_exists(r, btype2, true)); + CuAssertTrue(tc, !buildingtype_exists(r, NULL, false)); + CuAssertTrue(tc, buildingtype_exists(r, btype, false)); + CuAssertTrue(tc, !buildingtype_exists(r, btype2, false)); } CuSuite *get_move_suite(void)