Author: sveinung Date: Wed Dec 10 14:18:32 2014 New Revision: 27233 URL: http://svn.gna.org/viewcvs/freeciv?rev=27233&view=rev Log: AI: Don't try to make a unit that never can help build a wonder help build one.
Wonder building help is now controlled by action enablers. It is therefore possible for a unit type to have the HelpWonder flag without being able to help. See patch #5514 Modified: trunk/ai/default/aiunit.c trunk/common/aicore/caravan.c Modified: trunk/ai/default/aiunit.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aiunit.c?rev=27233&r1=27232&r2=27233&view=diff ============================================================================== --- trunk/ai/default/aiunit.c (original) +++ trunk/ai/default/aiunit.c Wed Dec 10 14:18:32 2014 @@ -2146,7 +2146,7 @@ if (!unit_can_do_action(punit, ACTION_TRADE_ROUTE) && !unit_can_do_action(punit, ACTION_MARKETPLACE) - && !unit_has_type_flag(punit, UTYF_HELP_WONDER)) { + && !unit_can_do_action(punit, ACTION_HELP_WONDER)) { /* we only want units that can establish trade, enter marketplace or * help build wonders */ return; @@ -2539,7 +2539,7 @@ return; } else if (unit_can_do_action(punit, ACTION_TRADE_ROUTE) || unit_can_do_action(punit, ACTION_MARKETPLACE) - || unit_has_type_flag(punit, UTYF_HELP_WONDER)) { + || unit_can_do_action(punit, ACTION_HELP_WONDER)) { TIMING_LOG(AIT_CARAVAN, TIMER_START); dai_manage_caravan(ait, pplayer, punit); TIMING_LOG(AIT_CARAVAN, TIMER_STOP); Modified: trunk/common/aicore/caravan.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/aicore/caravan.c?rev=27233&r1=27232&r2=27233&view=diff ============================================================================== --- trunk/common/aicore/caravan.c (original) +++ trunk/common/aicore/caravan.c Wed Dec 10 14:18:32 2014 @@ -61,7 +61,7 @@ && !unit_can_do_action(caravan, ACTION_TRADE_ROUTE)) { parameter->consider_windfall = FALSE; } - if (!unit_has_type_flag(caravan, UTYF_HELP_WONDER)) { + if (!unit_can_do_action(caravan, ACTION_HELP_WONDER)) { parameter->consider_wonders = FALSE; } } _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits