~ubuntu-branches/debian/sid/freeciv/sid

« back to all changes in this revision

Viewing changes to client/gui-xaw/cityrep.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams, Karl Goetz, Clint Adams
  • Date: 2010-02-23 22:09:02 UTC
  • mfrom: (7.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100223220902-s3spqi1x4e190y0t
[ Karl Goetz ]
* Remove civserver files in /etc/ggzd/ (Closes: 523772, 517787)
* Adding ${misc:Depends} to all binary packages (lintian warnings)

[ Clint Adams ]
* New upstream version.
  - Drop data_dsc_use_bindir.diff (binary pathnames have changed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <X11/Xaw/Toggle.h>
32
32
#include <X11/Xaw/Viewport.h>
33
33
 
 
34
/* common & utility */
34
35
#include "city.h"
35
36
#include "fcintl.h"
36
 
#include "game.h"
37
37
#include "log.h"
38
38
#include "mem.h"
39
39
#include "packets.h"
41
41
#include "support.h"
42
42
#include "unit.h"
43
43
 
 
44
/* client */
 
45
#include "client_main.h"
44
46
#include "climisc.h"
45
 
#include "clinet.h"
46
47
 
47
48
#include "chatline.h"
48
49
#include "citydlg.h"
321
322
 
322
323
  if(ret->list_index!=XAW_LIST_NONE && 
323
324
     (pcity=cities_in_list[ret->list_index])) {
324
 
    struct city_production targets[MAX_NUM_PRODUCTION_TARGETS];
 
325
    struct universal targets[MAX_NUM_PRODUCTION_TARGETS];
325
326
    struct item items[MAX_NUM_PRODUCTION_TARGETS];
326
327
    int targets_used = 0;
327
328
    size_t i;
338
339
                                        city_change_command,
339
340
                                        NULL);
340
341
 
341
 
    impr_type_iterate(impr) {
342
 
      if (can_build_improvement(pcity, impr)) {
343
 
        targets[targets_used].is_unit = false;
344
 
        targets[targets_used].value = impr;
 
342
    improvement_iterate(pimprove) {
 
343
      if (can_city_build_improvement_now(pcity, pimprove)) {
 
344
        targets[targets_used].kind = VUT_IMPROVEMENT;
 
345
        targets[targets_used].value.building = pimprove;
345
346
        targets_used++;
346
347
      }
347
 
    } impr_type_iterate_end;
 
348
    } improvement_iterate_end;
348
349
 
349
350
    unit_type_iterate(punittype) {
350
 
      if (can_build_unit(pcity, punittype)) {
351
 
        targets[targets_used].is_unit = true;
352
 
        targets[targets_used].value = punittype->index;
 
351
      if (can_city_build_unit_now(pcity, punittype)) {
 
352
        targets[targets_used].kind = VUT_UTYPE;
 
353
        targets[targets_used].value.utype = punittype;
353
354
        targets_used++;
354
355
      }
355
356
    } unit_type_iterate_end;
382
383
{
383
384
  XawListReturnStruct *ret=XawListShowCurrent(city_list);
384
385
  struct city *pcity;
385
 
  struct city_production production;
 
386
  struct universal production;
386
387
 
387
388
  if(ret->list_index!=XAW_LIST_NONE && 
388
389
     (pcity=cities_in_list[ret->list_index])) {
431
432
    struct city *pcity = cities_in_list[ret->list_index];
432
433
 
433
434
    if (pcity) {
434
 
      dsend_packet_city_refresh(&aconnection, pcity->id);
 
435
      dsend_packet_city_refresh(&client.conn, pcity->id);
435
436
    }
436
437
  } else {
437
 
    dsend_packet_city_refresh(&aconnection, 0);
 
438
    dsend_packet_city_refresh(&client.conn, 0);
438
439
  }
439
440
}
440
441
 
504
505
*****************************************************************/
505
506
void city_report_dialog_update(void)
506
507
{
507
 
  if (is_report_dialogs_frozen() || !game.player_ptr) {
 
508
  if (NULL == client.conn.playing || is_report_dialogs_frozen()) {
508
509
    return;
509
510
  }
 
511
 
510
512
  if(city_dialog_shell) {
511
513
    int i=0, n;
512
514
    Dimension width;
514
516
    static char **city_list_text = NULL;
515
517
    const char *report_title;
516
518
 
517
 
    n = city_list_size(game.player_ptr->cities);
 
519
    n = city_list_size(client.conn.playing->cities);
518
520
    freelog(LOG_DEBUG, "%d cities in report", n);
519
521
    if(n_alloc == 0 || n > n_alloc) {
520
522
      int j, n_prev = n_alloc;
546
548
     * having to find city corresponding to id for each comparison.
547
549
     */
548
550
    i=0;
549
 
    city_list_iterate(game.player_ptr->cities, pcity) {
 
551
    city_list_iterate(client.conn.playing->cities, pcity) {
550
552
      cities_in_list[i++] = pcity;
551
553
    } city_list_iterate_end;
552
554
    assert(i==n);
1078
1080
                                            XtPointer call_data)
1079
1081
{
1080
1082
  struct chgall_data *state = (struct chgall_data *) client_data;
1081
 
  struct city_production targets[MAX_NUM_PRODUCTION_TARGETS];
 
1083
  struct universal targets[MAX_NUM_PRODUCTION_TARGETS];
1082
1084
  struct item items[MAX_NUM_PRODUCTION_TARGETS];
1083
1085
  int i;
1084
1086