Author: sveinung
Date: Wed Dec 10 14:17:14 2014
New Revision: 27230

URL: http://svn.gna.org/viewcvs/freeciv?rev=27230&view=rev
Log:
AI: Path finding: Give non hostile actor units the same tile behavior.

Actor units only capable of performing non hostile actions will now avoid fights
on the way but will still do an action to a non ally if ordered to.

While the Freeciv AI still avoids establishing trade routes to non allies doing
so isn't illegal. It therefore won't hurt to allow it so the case of
establishing an embassy can be handled by the same code.

See patch #5511

Modified:
    trunk/ai/default/aitools.c

Modified: trunk/ai/default/aitools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aitools.c?rev=27230&r1=27229&r2=27230&view=diff
==============================================================================
--- trunk/ai/default/aitools.c  (original)
+++ trunk/ai/default/aitools.c  Wed Dec 10 14:17:14 2014
@@ -574,9 +574,11 @@
   } else if (unit_has_type_flag(punit, UTYF_CITIES)) {
     /* Short path */
     parameter->get_TB = no_fights;
-  } else if (unit_has_type_flag(punit, UTYF_TRADE_ROUTE)
-             || unit_has_type_flag(punit, UTYF_HELP_WONDER)) {
-    parameter->get_TB = no_fights;
+  } else if (is_actor_unit(punit)
+             && !utype_acts_hostile(unit_type(punit))) {
+    /* While the AI currently won't establish a trade route to a non ally
+     * it will establish an embassy. */
+    parameter->get_TB = no_intermediate_fights;
   } else if (unit_has_type_role(punit, L_BARBARIAN_LEADER)) {
     /* Avoid capture */
     parameter->get_TB = no_fights;


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

Reply via email to