Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10716) is_observer entry needed for savegame
Home

[Freeciv-Dev] (PR#10716) is_observer entry needed for savegame

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10716) is_observer entry needed for savegame
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 24 Oct 2004 21:47:39 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10716 >

jason says just don't save the observer in the savegame. good idea.

  i = 0
  players_iterate(pplayer) {
    if (!pplayer->is_observer) {
      player_save(pplayer, i++, file);
    }
  } players_iterate_end;

and

  bool has_obs = FALSE;
  players_iterate(pplayer) {
    if (pplayer->is_observer) {
       has_obs = TRUE;
    }
  } players_iterate_end;

  secfile_insert_int(file, has_obs ? game.nplayers - 1 : game.nplayers,    
                     "game.nplayers");

-mike




[Prev in Thread] Current Thread [Next in Thread]