URL:
  <http://gna.org/bugs/?17247>

                 Summary: Wrong comment in server/prlhand.c split_player()
                 Project: Freeciv
            Submitted by: kernigh
            Submitted on: Mon 06 Dec 2010 09:41:51 PM GMT
                Category: ai
                Severity: 2 - Minor
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: S2_2 r18700
         Discussion Lock: Any
        Operating System: *BSD
         Planned Release: 

    _______________________________________________________

Details:

The following comment in split_player() of server/plrhand.c of S2_2 r18700 is
wrong.


  cplayer = server_create_player();
  ...
  /* cplayer is not yet part of players_iterate which goes only
     to player_count(). */
  players_iterate(other_player) {
    ...


cplayer is part of players_iterate because server_create_player() added 1 to
the count. I verified this by inserting an assertion:


  cplayer = server_create_player();
  ...
  /* cplayer is not yet part of players_iterate which goes only
     to player_count(). */
  players_iterate(other_player) {
    assert(cplayer != other_player);
    ...


The assertion failed.

I am not sure if the fix is only to change the comment, or also to skip some
code if cplayer == other_player?




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?17247>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


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

Reply via email to