Author: sveinung
Date: Mon Jun 13 02:14:22 2016
New Revision: 32842

URL: http://svn.gna.org/viewcvs/freeciv?rev=32842&view=rev
Log:
auto attack: add back exotic attacks.

Auto attack's ability to do the "Capture Units" and "Bombard" attacks
was lost when they became action enabler controlled. Bring it back.

See bug #24744

Modified:
    trunk/server/unittools.c

Modified: trunk/server/unittools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unittools.c?rev=32842&r1=32841&r2=32842&view=diff
==============================================================================
--- trunk/server/unittools.c    (original)
+++ trunk/server/unittools.c    Mon Jun 13 02:14:22 2016
@@ -3055,9 +3055,23 @@
 #endif
 
       unit_activity_handling(penemy, ACTIVITY_IDLE);
-      /* Attack */
-      (void) unit_move_handling(penemy, unit_tile(punit),
-                                FALSE, TRUE, NULL);
+      if (is_action_enabled_unit_on_units(ACTION_CAPTURE_UNITS,
+                                          penemy, unit_tile(punit))) {
+        /* Choose capture. */
+        handle_unit_do_action(unit_owner(penemy),
+                              penemy->id, tile_index(unit_tile(punit)),
+                              0, "", ACTION_CAPTURE_UNITS);
+      } else if (is_action_enabled_unit_on_units(ACTION_BOMBARD,
+                                                 penemy, unit_tile(punit))) {
+        /* Choose bombard. */
+        handle_unit_do_action(unit_owner(penemy),
+                              penemy->id, tile_index(unit_tile(punit)),
+                              0, "", ACTION_BOMBARD);
+      } else {
+        /* Attack */
+        (void) unit_move_handling(penemy, unit_tile(punit),
+                                  FALSE, TRUE, NULL);
+      }
     } else {
 #ifdef REALLY_DEBUG_THIS
       log_test("!AA %s -> %s (%d,%d) %.2f > %.2f && > %.2f",


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

Reply via email to