Author: sveinung
Date: Wed Dec 10 14:18:19 2014
New Revision: 27232

URL: http://svn.gna.org/viewcvs/freeciv?rev=27232&view=rev
Log:
AI: Don't count units that can't help wonder as wonder helpers.

Action enabler control of Help build Wonder makes it possible to create a
ruleset were a unit has the HelpWonder unit flag but can't help build a wonder.

See patch #5513

Modified:
    trunk/ai/default/advdomestic.c

Modified: trunk/ai/default/advdomestic.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/advdomestic.c?rev=27232&r1=27231&r2=27232&view=diff
==============================================================================
--- trunk/ai/default/advdomestic.c      (original)
+++ trunk/ai/default/advdomestic.c      Wed Dec 10 14:18:19 2014
@@ -102,7 +102,7 @@
 
   /* Count existing caravans */
   unit_list_iterate(pplayer->units, punit) {
-    if (unit_has_type_flag(punit, UTYF_HELP_WONDER)
+    if (unit_can_do_action(punit, ACTION_HELP_WONDER)
         && tile_continent(unit_tile(punit)) == continent)
       caravans++;
   } unit_list_iterate_end;
@@ -110,7 +110,8 @@
   /* Count caravans being built */
   city_list_iterate(pplayer->cities, acity) {
     if (VUT_UTYPE == acity->production.kind
-        && utype_has_flag(acity->production.value.utype, UTYF_HELP_WONDER)
+        && utype_can_do_action(acity->production.value.utype,
+                               ACTION_HELP_WONDER)
         && tile_continent(acity->tile) == continent) {
       caravans++;
     }


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

Reply via email to