<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39911 >


The problem is with the player name in text.c, const char
*get_info_label_text(void). Change and add a printf() statement like this:


  if (!game.info.simultaneous_phases) {
    struct player *ply = get_player(game.info.phase);

    printf("player %p, name: %p\n", ply, ply->name);
    astr_add_line(&str, _("Moving: %s"), ply->name);
  }


This creates output like:


[...]
player 0x823babc, name: 0x823bac0
player 0x823e918, name: 0x823e91c
player 0x823e918, name: 0x823e91c
player 0x8241774, name: 0x8241778
player 0x8241774, name: 0x8241778
player 0x82445d0, name: 0x82445d4
player 0x82445d0, name: 0x82445d4
player (nil), name: 0x4


Now with ...


  if (!game.info.simultaneous_phases) {
    struct player *ply = get_player(game.info.phase);

    if(ply != NULL) {
      printf("player %p, name: %p\n", ply, ply->name);
      astr_add_line(&str, _("Moving: %s"), ply->name);
    }
    else {
      astr_add_line( &str, _("Moving: [unknown player]") );
    }
  }


... the client says "Moving: [unknown player]" and does not crash. While
the "unknown player" moved, I could see on the map that my own units
were moved, like Explorers that have the command "auto explore". After
that, the client says "Moving: Harry S. Truman", and I can make my next
turn.


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

Reply via email to