Summary: Gen-road unit orders not loaded correctly from
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Wed Jan  1 23:59:17 2014
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: trunk/S2_5 r23971
         Discussion Lock: Any
        Operating System: Any
         Planned Release: 2.5.0,2.6.0



Noticed in passing when reading the code:

When a unit has saved orders (such as a connect-with-road path), those are
saved in the savegame with single-character codes. Traditionally 'r' has been

This is now ACTIVITY_OLD_ROAD, and upper-case version 'R' has been allocated
for ACTIVITY_GEN_ROAD (with the road type elsewhere).

Unfortunately, savegame2.c:char2activity() matches case-insensitively, so on
loading, both 'r' and 'R' will be interpreted as ACTIVITY_OLD_ROAD (and the
road type will be ignored).

I couldn't conveniently set up a good test case -- with the classic ruleset
and basic roads, I think the OLD_ROAD order gets converted back into the
appropriate gen-road equivalent so the round-trip works for basic roads, but
presumably not for exotic roads.

Probably the simplest solution is to retrospectively declare that activity
codes are case-sensitive in savegame2 format files (after some checking that
they always have been, of course).


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to