~ubuntu-branches/debian/squeeze/freeciv/squeeze

« back to all changes in this revision

Viewing changes to ai/aidata.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2008-11-29 22:25:59 UTC
  • mfrom: (1.2.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081129222559-6sqqdum8qnhykm4l
Tags: 2.1.8-1
* New upstream release.  closes: #495740.
* Disable GGZ support (can be re-enabled when ggz 1.0 is available).
* Change maintainer to Debian Games Team.

Show diffs side-by-side

added added

removed removed

Lines of Context:
256
256
     * coastal fortresses and hunting down enemy transports. */
257
257
    city_list_iterate(aplayer->cities, acity) {
258
258
      Continent_id continent = tile_get_continent(acity->tile);
259
 
      ai->threats.continent[continent] = TRUE;
 
259
      if (continent >= 0) {
 
260
        ai->threats.continent[continent] = TRUE;
 
261
      }
260
262
    } city_list_iterate_end;
261
263
 
262
264
    unit_list_iterate(aplayer->units, punit) {
364
366
  ai->stats.cities = fc_calloc(ai->num_continents + 1, sizeof(int));
365
367
  ai->stats.average_production = 0;
366
368
  city_list_iterate(pplayer->cities, pcity) {
367
 
    ai->stats.cities[(int)tile_get_continent(pcity->tile)]++;
 
369
    Continent_id continent = tile_get_continent(pcity->tile);
 
370
    if (continent >= 0) {
 
371
      ai->stats.cities[continent]++;
 
372
    }
368
373
    ai->stats.average_production += pcity->surplus[O_SHIELD];
369
374
  } city_list_iterate_end;
370
375
  ai->stats.average_production /= MAX(1, city_list_size(pplayer->cities));