diff --git a/src/battle.c b/src/battle.c index 44299df1e..599631e30 100644 --- a/src/battle.c +++ b/src/battle.c @@ -1927,7 +1927,7 @@ int skilldiff(troop at, troop dt, int dist) } if (b->type->flags & BTF_FORTIFICATION) { int stage = buildingeffsize(b, false); - int beff = building_protection(b->type, stage); + int beff = bt_protection(b->type, stage); if (beff > 0) { skdiff -= beff; is_protected = 2; diff --git a/src/battle.test.c b/src/battle.test.c index 08adce803..41ae94db6 100644 --- a/src/battle.test.c +++ b/src/battle.test.c @@ -325,19 +325,19 @@ static void test_building_defense_bonus(CuTest * tc) btype = setup_castle(); btype->maxsize = -1; /* unlimited buildigs get the castle bonus */ - CuAssertIntEquals(tc, 0, building_protection(btype, 0)); - CuAssertIntEquals(tc, 1, building_protection(btype, 1)); - CuAssertIntEquals(tc, 3, building_protection(btype, 2)); - CuAssertIntEquals(tc, 5, building_protection(btype, 3)); - CuAssertIntEquals(tc, 8, building_protection(btype, 4)); - CuAssertIntEquals(tc, 12, building_protection(btype, 5)); - CuAssertIntEquals(tc, 12, building_protection(btype, 6)); + CuAssertIntEquals(tc, 0, bt_protection(btype, 0)); + CuAssertIntEquals(tc, 1, bt_protection(btype, 1)); + CuAssertIntEquals(tc, 3, bt_protection(btype, 2)); + CuAssertIntEquals(tc, 5, bt_protection(btype, 3)); + CuAssertIntEquals(tc, 8, bt_protection(btype, 4)); + CuAssertIntEquals(tc, 12, bt_protection(btype, 5)); + CuAssertIntEquals(tc, 12, bt_protection(btype, 6)); btype->maxsize = 10; /* limited-size buildings are treated like an E3 watchtower */ - CuAssertIntEquals(tc, 0, building_protection(btype, 0)); - CuAssertIntEquals(tc, 1, building_protection(btype, 1)); - CuAssertIntEquals(tc, 2, building_protection(btype, 2)); - CuAssertIntEquals(tc, 2, building_protection(btype, 3)); + CuAssertIntEquals(tc, 0, bt_protection(btype, 0)); + CuAssertIntEquals(tc, 1, bt_protection(btype, 1)); + CuAssertIntEquals(tc, 2, bt_protection(btype, 2)); + CuAssertIntEquals(tc, 2, bt_protection(btype, 3)); test_teardown(); } diff --git a/src/kernel/building.c b/src/kernel/building.c index d0a41c661..7dd4a523f 100644 --- a/src/kernel/building.c +++ b/src/kernel/building.c @@ -320,7 +320,7 @@ int cmp_castle_size(const building * b, const building * a) static const int castle_bonus[6] = { 0, 1, 3, 5, 8, 12 }; static const int watch_bonus[3] = { 0, 1, 2 }; -int building_protection(const building_type * btype, int stage) +int bt_protection(const building_type * btype, int stage) { assert(btype->flags & BTF_FORTIFICATION); if (btype->maxsize < 0) { diff --git a/src/kernel/building.h b/src/kernel/building.h index dfe1b544a..7b48aa3ad 100644 --- a/src/kernel/building.h +++ b/src/kernel/building.h @@ -68,7 +68,7 @@ extern "C" { extern struct attrib_type at_building_generic_type; int cmp_castle_size(const struct building *b, const struct building *a); - int building_protection(const struct building_type *btype, int stage); + int bt_protection(const struct building_type *btype, int stage); building_type *bt_get_or_create(const char *name); bool bt_changed(int *cache); const building_type *bt_find(const char *name);