From 735fd36a4dfcdaba29da107c5d4aef3aa58a3f83 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 27 Dec 2025 11:46:13 +0200
Subject: [PATCH 45/45] dai_unit_attack(): Handle fake-generalized versions of
 actions

Consider fake-generalized versions of attack actions just
the same as the base versions.

See RM #1847

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 ai/default/daitools.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/ai/default/daitools.c b/ai/default/daitools.c
index 0a88c1fcab..ded5f65f86 100644
--- a/ai/default/daitools.c
+++ b/ai/default/daitools.c
@@ -847,6 +847,11 @@ bool dai_unit_attack(struct ai_type *ait, struct unit *punit,
     /* Choose "Bombard Lethal". */
     unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
                    0, "", ACTION_BOMBARD_LETHAL);
+  } else if (is_action_enabled_unit_on_stack(nmap, ACTION_BOMBARD_LETHAL2,
+                                             punit, ptile)) {
+    /* Choose "Bombard Lethal 2". */
+    unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
+                   0, "", ACTION_BOMBARD_LETHAL2);
   } else if (is_action_enabled_unit_on_stack(nmap, ACTION_BOMBARD,
                                              punit, ptile)) {
     /* Choose "Bombard". */
@@ -862,6 +867,11 @@ bool dai_unit_attack(struct ai_type *ait, struct unit *punit,
     /* Choose "Bombard 3". */
     unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
                    0, "", ACTION_BOMBARD3);
+  } else if (is_action_enabled_unit_on_stack(nmap, ACTION_BOMBARD4,
+                                             punit, ptile)) {
+    /* Choose "Bombard 4". */
+    unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
+                   0, "", ACTION_BOMBARD4);
   } else if (is_action_enabled_unit_on_stack(nmap, ACTION_NUKE_UNITS,
                                              punit, ptile)) {
     /* Choose "Nuke Units". */
@@ -898,11 +908,21 @@ bool dai_unit_attack(struct ai_type *ait, struct unit *punit,
     /* Choose regular attack. */
     unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
                    0, "", ACTION_ATTACK);
+  } else if (is_action_enabled_unit_on_stack(nmap, ACTION_ATTACK2,
+                                             punit, ptile)) {
+    /* Choose regular attack 2. */
+    unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
+                   0, "", ACTION_ATTACK2);
   } else if (is_action_enabled_unit_on_stack(nmap, ACTION_SUICIDE_ATTACK,
                                              punit, ptile)) {
     /* Choose suicide attack (explode missile). */
     unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
                    0, "", ACTION_SUICIDE_ATTACK);
+  } else if (is_action_enabled_unit_on_stack(nmap, ACTION_SUICIDE_ATTACK2,
+                                             punit, ptile)) {
+    /* Choose suicide attack (explode missile) 2. */
+    unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
+                   0, "", ACTION_SUICIDE_ATTACK2);
   } else if ((tcity = tile_city(ptile))
              && is_action_enabled_unit_on_city(nmap, ACTION_CONQUER_CITY_SHRINK,
                                                punit, tcity)) {
-- 
2.51.0

