Summary: "onsetbarbs" in pre-2.3 savegames/scenarios is
reset to 0 on load
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Mon Aug  8 22:33:38 2011
                Category: general
                Severity: 4 - Important
                Priority: 5 - Normal
                  Status: Ready For Test
             Assigned to: jtn
        Originator Email: 
             Open/Closed: Open
                 Release: 2.3.0
         Discussion Lock: Any
        Operating System: Any
         Planned Release: 2.3.1,2.4.0



In S2_3's savegame.c is the following check:

/* old savegames use the year while newer savegames use the turn. */
game.server.onsetbarbarian = MIN(0, game.server.onsetbarbarian);

I think this is trying to patch up savegames which have negative onsetbarbs
values like -2000 so that they're not actually illegal. Unfortunately, to
achieve this it would need to be MAX, not MIN.

This means that any pre-2.3 savegame with a non-zero "onsetbarbs" gets it
reset to zero. This is most keenly felt with scenarios, such as the tutorial
scenario, where new players are subjected to barbarians right from the start
(which is how I found this) -- the defaults (and the tutorial) give players 60
barbarian-free turns.

Looks like this came in in bug #17513 (and hence only affects S2_3 and

Quick fix attached. A better fix would try to convert negative values (which
must be in years) to the equivalent number of turns.


File Attachments:

Date: Mon Aug  8 22:33:39 2011  Name: S2_3-onsetbarbs.diff  Size: 637B   By:
S2_3 r20077 (probably applies to trunk too)


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to