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

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
--- 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

Reply via email to