From 5a5edee47e8494ec1dad76e632eeb63632bc695b 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 | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/common/movement.c b/common/movement.c index 4ab460fd8a..e20a3bf2c9 100644 --- a/common/movement.c +++ b/common/movement.c @@ -216,20 +216,15 @@ 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_WIPE_UNITS, - USP_LIVABLE_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_WIPE_UNITS, + USP_LIVABLE_TILE, FALSE) + || utype_can_do_action_result_when_ustate(utype, + ACTRES_CONQUER_CITY, + USP_LIVABLE_TILE, + FALSE)); } /************************************************************************//** -- 2.30.2