Project

General

Profile

Bug #1242 » 0045-AI-Check-is_action_enabled_unit_on_stack-in-dai_ramp.patch

main, S3_3, S3_2 - Marko Lindqvist, 04/17/2025 05:12 AM

View differences:

ai/default/daiunit.c
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_stack(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);
(5-5/5)