From ad4c430a33a0ed5f009e8f253f4e5518a1cc662e Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Mon, 3 May 2021 11:51:03 +0200 Subject: [PATCH] can_attack_from_non_native() by action result. See osdn #42161 --- common/movement.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/common/movement.c b/common/movement.c index 4e6fab72ca..7475f8279d 100644 --- a/common/movement.c +++ b/common/movement.c @@ -205,18 +205,12 @@ bool can_attack_non_native(const struct unit_type *utype) ****************************************************************************/ bool can_attack_from_non_native(const struct unit_type *utype) { - return (utype_can_do_act_when_ustate(utype, ACTION_ATTACK, - USP_NATIVE_TILE, FALSE) - || utype_can_do_act_when_ustate(utype, ACTION_SUICIDE_ATTACK, - USP_NATIVE_TILE, FALSE) - || utype_can_do_act_when_ustate(utype, ACTION_CONQUER_CITY4, - USP_LIVABLE_TILE, FALSE) - || utype_can_do_act_when_ustate(utype, ACTION_CONQUER_CITY3, - USP_LIVABLE_TILE, FALSE) - || utype_can_do_act_when_ustate(utype, ACTION_CONQUER_CITY2, - USP_LIVABLE_TILE, FALSE) - || utype_can_do_act_when_ustate(utype, ACTION_CONQUER_CITY, - USP_LIVABLE_TILE, FALSE)); + return (utype_can_do_action_result_when_ustate(utype, ACTRES_ATTACK, + USP_NATIVE_TILE, FALSE) + || utype_can_do_action_result_when_ustate(utype, + ACTRES_CONQUER_CITY, + USP_LIVABLE_TILE, + FALSE)); } /************************************************************************//** -- 2.30.2