Author: sveinung
Date: Thu Oct  6 14:03:28 2016
New Revision: 34017

URL: http://svn.gna.org/viewcvs/freeciv?rev=34017&view=rev
Log:
ai: consider actions when assessing danger.

"Attack" and "Occupy City" are action enabler controlled. Look at the
actions to take more unit requirements into account.

See patch #7773

Modified:
    trunk/ai/default/daimilitary.c

Modified: trunk/ai/default/daimilitary.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/daimilitary.c?rev=34017&r1=34016&r2=34017&view=diff
==============================================================================
--- trunk/ai/default/daimilitary.c      (original)
+++ trunk/ai/default/daimilitary.c      Thu Oct  6 14:03:28 2016
@@ -555,9 +555,8 @@
       if (!utai->carries_occupiers
           && !utype_acts_hostile(utype)
           && (utype_has_flag(utype, UTYF_CIVILIAN)
-              || (0 >= utype->attack_strength
-                  && !uclass_has_flag(utype_class(utype),
-                                      UCF_CAN_OCCUPY_CITY)))) {
+              || (!utype_can_do_action(utype, ACTION_ATTACK)
+                  && !utype_can_take_over(utype)))) {
         /* Harmless unit. */
         continue;
       }


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

Reply via email to