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

« back to all changes in this revision

Viewing changes to common/improvement.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:
306
306
}
307
307
 
308
308
/**************************************************************************
 
309
  Returns TRUE iff improvement provides units buildable by player
 
310
**************************************************************************/
 
311
bool impr_provides_buildable_units(const struct player *pplayer,
 
312
                                   Impr_type_id id)
 
313
{
 
314
  struct impr_type *impr = improvement_by_number(id);
 
315
 
 
316
  /* Fast check */
 
317
  if (! impr->allows_units) {
 
318
    return FALSE;
 
319
  }
 
320
 
 
321
  unit_type_iterate(ut) {
 
322
    if (ut->impr_requirement == id) {
 
323
      if (can_player_build_unit(pplayer, ut)) {
 
324
        return TRUE;
 
325
      }
 
326
    }
 
327
  } unit_type_iterate_end;
 
328
 
 
329
  return FALSE;
 
330
}
 
331
 
 
332
/**************************************************************************
309
333
   Whether player can build given building somewhere, ignoring whether it
310
334
   is obsolete.
311
335
**************************************************************************/