Author: cazfi
Date: Sun Nov 23 03:59:01 2014
New Revision: 27113

URL: http://svn.gna.org/viewcvs/freeciv?rev=27113&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:
    branches/S2_4/ai/default/aicity.c

Modified: branches/S2_4/ai/default/aicity.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_4/ai/default/aicity.c?rev=27113&r1=27112&r2=27113&view=diff
==============================================================================
--- branches/S2_4/ai/default/aicity.c   (original)
+++ branches/S2_4/ai/default/aicity.c   Sun Nov 23 03:59:01 2014
@@ -645,6 +645,9 @@
   struct adv_data *ai = adv_data_get(pplayer, NULL);
   struct unit_type *unit_type = best_role_unit(pcity, F_SETTLERS);
   Continent_id place = tile_continent(pcenter);
+  struct ai_city *city_data = def_ai_city_data(pcity);
+
+  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 F_SETTLERS role unit available");
@@ -686,7 +689,7 @@
            ai->stats.cities[place]);
   fc_assert(want >= 0);
 
-  def_ai_city_data(pcity)->settler_want = want;
+  city_data->settler_want = want;
 }
 
 /**************************************************************************


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

Reply via email to