From 9a33abf1a7933573d750bf846177c10134c03581 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(), unit_attack_units_at_tile_result() and unit_wipe_units_at_tile_result(). See osdn #42006 --- common/combat.c | 27 ++++++++++++++++----------- common/combat.h | 17 ++++++++++------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/common/combat.c b/common/combat.c index 99df4f1ebd..0a030c1316 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 (!(utype_can_do_action(unit_type_get(punit), ACTION_ATTACK) @@ -164,8 +165,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 and UTYF_NEVER_PROTECTS 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) { bool any_reachable_unit = FALSE; bool any_neverprotect_unit = FALSE; @@ -202,8 +204,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; @@ -226,8 +229,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); @@ -239,8 +243,9 @@ enum unit_attack_result unit_attack_units_at_tile_result(const struct unit *puni /*******************************************************************//** Check if unit can wipe unit stack from tile. ***********************************************************************/ -enum unit_attack_result unit_wipe_units_at_tile_result(const struct unit *punit, - const struct tile *ptile) +enum unit_attack_result +unit_wipe_units_at_tile_result(const struct unit *punit, + const struct tile *ptile) { /* Can unit wipe in general? */ if (!utype_can_do_action(unit_type_get(punit), ACTION_WIPE_UNITS)) { diff --git a/common/combat.h b/common/combat.h index 1ef9b0c99e..5d41d2d649 100644 --- a/common/combat.h +++ b/common/combat.h @@ -41,13 +41,16 @@ enum unit_attack_result { bool is_unit_reachable_at(const struct unit *defender, const struct unit *attacker, const struct tile *location); -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_wipe_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); +enum unit_attack_result +unit_wipe_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