Follow-up Comment #6, bug #21126 (project freeciv):

Digging into how I managed to make so many mistakes:

I think I made this much worse on S2_5+ in patch #3443 (nation colours);
before that (and hence on current S2_4), server_create_player() assigns a
colour if passed NULL outside of pregame (so the comment referred to in
comment #2 used to be more correct); afterward, it became the caller's
responsibility. My mistakes were (a) not updating the comment (b) not checking
all callers thoroughly enough (particularly savegame loading).

* (Loading many S2_3 games into say S2_5 causes no obvious difficulty, which
surprised me. Turns out the colorlessness of players persists indefinitely in
the server, but with the default plrcolormode, the client gets the 'virtual'
colors from player_get_preferred_color(), so all seems to be well until a save
is attempted. Perhaps adding an assertion in package_player_info() based on
server state would be a good idea.)

Since S2_4 has different invariants, I think any patch for that branch
probably needs to be a different shape.
I think the bug is less severe there, too -- loading 2.3 savegames is fine, so
I think the only issue is in loading then saving a pregame savegame (which is
somewhat theoretical)? If so, perhaps we should put this cleanup back to
2.4.3?

Also: in the current patch, in sg_save_player_main(), the sense of the
"Colorless player outside pregame" test is wrong (generates errors when saving
a valid game).

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  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