Author: sveinung
Date: Sun Oct 11 19:21:56 2015
New Revision: 30054

URL: http://svn.gna.org/viewcvs/freeciv?rev=30054&view=rev
Log:
ai: hostile actors shouldn't fight en route

The function dai_fill_unit_paramdai_fill_unit_param() sets the path finding
parameters for an AI unit in some situations. Examples are moving a unit to
a safe city and moving a barbarian leader to a safe tile.

Before this patch dai_fill_unit_paramdai_fill_unit_param() would set the
tile behavior for units capable of performing hostile actions in a way that
assumed they could walk through enemy units and cities.

The hostile actions are most of the spy actions.

The code used to perform a spy action doesn't set path finding parameters
via dai_fill_unit_paramdai_fill_unit_param(). It sets tile behavior to no
intermediate fights.

Make dai_fill_unit_paramdai_fill_unit_param() set the path finding tile
behavior of hostile actors to no intermediate fights.

See patch #6400

Modified:
    branches/S2_6/ai/default/aitools.c

Modified: branches/S2_6/ai/default/aitools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/ai/default/aitools.c?rev=30054&r1=30053&r2=30054&view=diff
==============================================================================
--- branches/S2_6/ai/default/aitools.c  (original)
+++ branches/S2_6/ai/default/aitools.c  Sun Oct 11 19:21:56 2015
@@ -561,7 +561,7 @@
   }
 
   if (utype_acts_hostile(unit_type(punit))) {
-    /* Default tile behaviour */
+    parameter->get_TB = no_intermediate_fights;
   } else if (unit_has_type_flag(punit, UTYF_SETTLERS)) {
     parameter->get_TB = no_fights;
   } else if (long_path && unit_is_cityfounder(punit)) {


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

Reply via email to