From 6d104362b642732fd4868f237625a2a1f7c6cae5 Mon Sep 17 00:00:00 2001 From: Dino Date: Tue, 18 Feb 2025 00:14:24 -0500 Subject: [PATCH] bug #1242 - add call to is_action_enabled_unit_on_units() inside of dai_rampage_want() --- ai/default/aiunit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ai/default/aiunit.c b/ai/default/aiunit.c index 3af3fb5c11..471b7d0d7b 100644 --- a/ai/default/aiunit.c +++ b/ai/default/aiunit.c @@ -462,7 +462,10 @@ static int dai_rampage_want(struct unit *punit, struct tile *ptile) CHECK_UNIT(punit); if (can_unit_attack_tile(punit, NULL, ptile) - && (pdef = get_defender(nmap, punit, ptile))) { + && (pdef = get_defender(nmap, punit, ptile)) + /* action enablers might prevent attacking */ + && is_action_enabled_unit_on_units(nmap, ACTION_ATTACK, + punit, ptile)) { /* See description of kill_desire() about these variables. */ int attack = unit_att_rating_now(punit); int benefit = stack_cost(punit, pdef); -- 2.31.0