Author: sveinung
Date: Wed Oct 12 16:13:40 2016
New Revision: 34108

URL: http://svn.gna.org/viewcvs/freeciv?rev=34108&view=rev
Log:
Auto attack is performed by the rules.

When the autoattack setting is enabled a server side auto attack happens
automatically. This means that auto attack isn't player performed. The
player doesn't control if his units (or a particular unit) should auto
attack or not. This means that auto attack isn't controlled by a server side
agent. The autoattack setting is a rule. Declare that the actions performed
by it is done by the rules.

See patch #7811

Modified:
    trunk/server/unittools.c

Modified: trunk/server/unittools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unittools.c?rev=34108&r1=34107&r2=34108&view=diff
==============================================================================
--- trunk/server/unittools.c    (original)
+++ trunk/server/unittools.c    Wed Oct 12 16:13:40 2016
@@ -3122,21 +3122,21 @@
       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);
+        unit_perform_action(unit_owner(penemy),
+                            penemy->id, tile_index(unit_tile(punit)),
+                            0, "", ACTION_CAPTURE_UNITS, ACT_REQ_RULES);
       } 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);
+        unit_perform_action(unit_owner(penemy),
+                            penemy->id, tile_index(unit_tile(punit)),
+                            0, "", ACTION_BOMBARD, ACT_REQ_RULES);
       } else if (is_action_enabled_unit_on_tile(ACTION_ATTACK,
                                                 penemy, unit_tile(punit))) {
         /* Choose regular attack. */
-        handle_unit_do_action(unit_owner(penemy),
-                              penemy->id, tile_index(unit_tile(punit)),
-                              0, "", ACTION_ATTACK);
+        unit_perform_action(unit_owner(penemy),
+                            penemy->id, tile_index(unit_tile(punit)),
+                            0, "", ACTION_ATTACK, ACT_REQ_RULES);
       }
     } else {
 #ifdef REALLY_DEBUG_THIS


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

Reply via email to