From 6b1e63d35cf215dbc088fa467654fb6effcd4a7e Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Thu, 15 Apr 2021 11:41:17 +0200 Subject: [PATCH] Fix unit_attack_*_at_tile_result() header length. Fix the line length of the function headers of unit_attack_unit_at_tile_result(), unit_attack_all_at_tile_result(), unit_attack_any_at_tile_result() and unit_attack_units_at_tile_result(). See osdn #42006 --- common/combat.c | 22 +++++++++++++--------- common/combat.h | 12 +++++++----- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/common/combat.c b/common/combat.c index 3b6fb0eb62..dbe7ca2825 100644 --- a/common/combat.c +++ b/common/combat.c @@ -118,9 +118,10 @@ bool is_unit_reachable_at(const struct unit *defender, 2) Adjacency 3) Diplomatic status ***********************************************************************/ -enum unit_attack_result unit_attack_unit_at_tile_result(const struct unit *punit, - const struct unit *pdefender, - const struct tile *dest_tile) +enum unit_attack_result +unit_attack_unit_at_tile_result(const struct unit *punit, + const struct unit *pdefender, + const struct tile *dest_tile) { /* 1. Can we attack _anything_ ? */ if (!is_military_unit(punit) || !is_attack_unit(punit)) { @@ -153,8 +154,9 @@ enum unit_attack_result unit_attack_unit_at_tile_result(const struct unit *punit To attack a stack, unit must be able to attack every unit there (not including transported units). ************************************************************************/ -static enum unit_attack_result unit_attack_all_at_tile_result(const struct unit *punit, - const struct tile *ptile) +static enum unit_attack_result +unit_attack_all_at_tile_result(const struct unit *punit, + const struct tile *ptile) { unit_list_iterate(ptile->units, aunit) { /* HACK: we don't count transported units here. This prevents some @@ -180,8 +182,9 @@ static enum unit_attack_result unit_attack_all_at_tile_result(const struct unit To attack a stack, unit must be able to attack some unit there (not including transported units). ************************************************************************/ -static enum unit_attack_result unit_attack_any_at_tile_result(const struct unit *punit, - const struct tile *ptile) +static enum unit_attack_result +unit_attack_any_at_tile_result(const struct unit *punit, + const struct tile *ptile) { enum unit_attack_result result = ATT_OK; @@ -204,8 +207,9 @@ static enum unit_attack_result unit_attack_any_at_tile_result(const struct unit /*********************************************************************** Check if unit can attack unit stack at tile. ***********************************************************************/ -enum unit_attack_result unit_attack_units_at_tile_result(const struct unit *punit, - const struct tile *ptile) +enum unit_attack_result +unit_attack_units_at_tile_result(const struct unit *punit, + const struct tile *ptile) { if (game.info.unreachable_protects) { return unit_attack_all_at_tile_result(punit, ptile); diff --git a/common/combat.h b/common/combat.h index 1853480a2d..2df3888001 100644 --- a/common/combat.h +++ b/common/combat.h @@ -41,11 +41,13 @@ bool is_unit_reachable_at(const struct unit *defender, const struct tile *location); bool can_player_attack_tile(const struct player *pplayer, const struct tile *ptile); -enum unit_attack_result unit_attack_unit_at_tile_result(const struct unit *punit, - const struct unit *pdefender, - const struct tile *dest_tile); -enum unit_attack_result unit_attack_units_at_tile_result(const struct unit *punit, - const struct tile *ptile); +enum unit_attack_result +unit_attack_unit_at_tile_result(const struct unit *punit, + const struct unit *pdefender, + const struct tile *dest_tile); +enum unit_attack_result +unit_attack_units_at_tile_result(const struct unit *punit, + const struct tile *ptile); bool can_unit_attack_tile(const struct unit *punit, const struct tile *ptile); -- 2.30.2