From 89690bc11488c9724140b5be6aa527ea3c6f3bdf Mon Sep 17 00:00:00 2001 From: Dino Date: Tue, 18 Feb 2025 00:08:50 -0500 Subject: [PATCH] bug #1242 - add call to is_action_enabled_unit_on_units() inside of dai_rampage_want() --- ai/default/daiunit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ai/default/daiunit.c b/ai/default/daiunit.c index 30d5725ec0..dde6cac363 100644 --- a/ai/default/daiunit.c +++ b/ai/default/daiunit.c @@ -463,7 +463,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, NULL))) { + && (pdef = get_defender(nmap, punit, ptile, NULL)) + /* 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