Author: sveinung
Date: Tue Jul 28 15:28:17 2015
New Revision: 29253

URL: http://svn.gna.org/viewcvs/freeciv?rev=29253&view=rev
Log:
AI: Explode Nuclear when possible.

See bug #23713

Modified:
    trunk/ai/default/aiair.c
    trunk/ai/default/aitools.c

Modified: trunk/ai/default/aiair.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aiair.c?rev=29253&r1=29252&r2=29253&view=diff
==============================================================================
--- trunk/ai/default/aiair.c    (original)
+++ trunk/ai/default/aiair.c    Tue Jul 28 15:28:17 2015
@@ -405,6 +405,12 @@
           handle_unit_do_action(unit_owner(punit),
                                 punit->id, tile_index(dst_tile),
                                 0, "", ACTION_BOMBARD);
+        } else if (is_action_enabled_unit_on_tile(ACTION_NUKE,
+                                                  punit, dst_tile)) {
+          /* Choose explode nuclear. */
+          handle_unit_do_action(unit_owner(punit),
+                                punit->id, tile_index(dst_tile),
+                                0, "", ACTION_NUKE);
         } else {
           (void) unit_move_handling(punit, dst_tile, TRUE, FALSE);
         }

Modified: trunk/ai/default/aitools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aitools.c?rev=29253&r1=29252&r2=29253&view=diff
==============================================================================
--- trunk/ai/default/aitools.c  (original)
+++ trunk/ai/default/aitools.c  Tue Jul 28 15:28:17 2015
@@ -853,6 +853,11 @@
     /* Choose bombard. */
     handle_unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
                           0, "", ACTION_BOMBARD);
+  } if (is_action_enabled_unit_on_tile(ACTION_NUKE,
+                                       punit, ptile)) {
+    /* Choose explode nuclear. */
+    handle_unit_do_action(unit_owner(punit), punit->id, tile_index(ptile),
+                          0, "", ACTION_NUKE);
   } else {
     /* Regular attack. */
     (void) unit_move_handling(punit, ptile, FALSE, FALSE);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to