Author: cazfi Date: Sun Nov 23 03:58:47 2014 New Revision: 27111 URL: http://svn.gna.org/viewcvs/freeciv?rev=27111&view=rev Log: Give workers zero want if they are not an viable option at all. This used to remember previous want, potentially causing workers to be built when it made no sense at all.
See bug #22972 Modified: trunk/ai/default/aicity.c Modified: trunk/ai/default/aicity.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aicity.c?rev=27111&r1=27110&r2=27111&view=diff ============================================================================== --- trunk/ai/default/aicity.c (original) +++ trunk/ai/default/aicity.c Sun Nov 23 03:58:47 2014 @@ -671,6 +671,9 @@ struct unit_type *unit_type = dai_role_utype_for_terrain_class(pcity, UTYF_SETTLERS, TC_LAND); Continent_id place = tile_continent(pcenter); + struct ai_city *city_data = def_ai_city_data(pcity, ait); + + city_data->settler_want = 0; /* Make sure old want does not stay if we don't want now */ if (unit_type == NULL) { log_debug("No UTYF_SETTLERS role unit available"); @@ -712,7 +715,7 @@ adv->stats.cities[place]); fc_assert(want >= 0); - def_ai_city_data(pcity, ait)->settler_want = want; + city_data->settler_want = want; } /************************************************************************** _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits