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

                 Summary: Savecompat conversions assume consecutive player
numbers
                 Project: Freeciv
            Submitted by: cazfi
            Submitted on: Fri 19 Feb 2016 11:55:05 PM EET
                Category: general
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: 2.5.4, 2.6.0, 3.0.0

    _______________________________________________________

Details:

I were checking why a 2.5 scenario from
http://forum.freeciv.org/f/viewtopic.php?f=24&t=762#p4538
does not load to newer branches.
The error messages loading gives are about the fact that there's no player10
(there's other holes in the array later on, but that's the first one and where
things break), player numbers are not consecutive.

The main savegame?.c modules are prepared to that since they do
  player_slots_iterate(pslot) {
    if (NULL == secfile_section_lookup(loading->file, "player%d",
                                       pslot_id)) {
      continue;
    }

However, in the savecompat conversion functions the usual way to update
players is
   for (plrno = 0; plrno < nplayers; plrno++) {

There are some cases where it *does* check that section "player%d" exist, but
I suspect those too go wrong in that the iteration anyway ends at plrno ==
nplayers despite some slots up to plrno have not been used -> do not count
toward nplayers.

With that scenario file it's shown that S2_6 and TRUNK are affceted. I suspect
that S2_5 is too, if loading savegame from older versions.




    _______________________________________________________

Reply to this item at:

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

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


_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to