<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40422 >
$subject - ML
diff -Nurd -X.diff_ignore freeciv/ai/aidata.c freeciv/ai/aidata.c --- freeciv/ai/aidata.c 2008-06-18 18:49:37.000000000 +0300 +++ freeciv/ai/aidata.c 2008-08-09 00:58:38.000000000 +0300 @@ -256,7 +256,9 @@ * coastal fortresses and hunting down enemy transports. */ city_list_iterate(aplayer->cities, acity) { Continent_id continent = tile_continent(acity->tile); - ai->threats.continent[continent] = TRUE; + if (continent >= 0) { + ai->threats.continent[continent] = TRUE; + } } city_list_iterate_end; unit_list_iterate(aplayer->units, punit) { @@ -411,7 +413,10 @@ ai->stats.cities = fc_calloc(ai->num_continents + 1, sizeof(int)); ai->stats.average_production = 0; city_list_iterate(pplayer->cities, pcity) { - ai->stats.cities[(int)tile_continent(pcity->tile)]++; + int continent = tile_continent(pcity->tile); + if (continent >= 0) { + ai->stats.cities[(int)tile_continent(pcity->tile)]++; + } ai->stats.average_production += pcity->surplus[O_SHIELD]; } city_list_iterate_end; ai->stats.average_production /= MAX(1, city_list_size(pplayer->cities));
_______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev