Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2005:
[Freeciv-Dev] (PR#13564) broken savegames from city_production struct
Home

[Freeciv-Dev] (PR#13564) broken savegames from city_production struct

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13564) broken savegames from city_production struct
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 29 Jul 2005 20:56:26 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13564 >

The city_production change for pcity->currently_building broke savegames
because of an overzealous search-and-replace.  This patch fixes it by
reverting the registry string changes.

-jason

Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.270
diff -p -u -r1.270 savegame.c
--- server/savegame.c   28 Jul 2005 17:59:07 -0000      1.270
+++ server/savegame.c   30 Jul 2005 03:55:30 -0000
@@ -2038,20 +2038,20 @@ static void player_load(struct player *p
                                           plrno, i);
     pcity->production.is_unit =
       secfile_lookup_bool(file, 
-                        "player%d.c%d.production.is_unit", plrno, i);
+                        "player%d.c%d.is_building_unit", plrno, i);
     name = secfile_lookup_str_default(file, NULL,
-                                     "player%d.c%d.production.value_name",
+                                     "player%d.c%d.currently_building_name",
                                      plrno, i);
     if (pcity->production.is_unit) {
       if (!name) {
-       id = secfile_lookup_int(file, "player%d.c%d.production.value", 
+       id = secfile_lookup_int(file, "player%d.c%d.currently_building", 
                                plrno, i);
        name = old_unit_type_name(id);
       }
       pcity->production.value = find_unit_type_by_name_orig(name)->index;
     } else {
       if (!name) {
-       id = secfile_lookup_int(file, "player%d.c%d.production.value",
+       id = secfile_lookup_int(file, "player%d.c%d.currently_building",
                                plrno, i);
        name = old_impr_type_name(id);
       }
@@ -2873,19 +2873,19 @@ static void player_save(struct player *p
     secfile_insert_str(file, citymap_buf, "player%d.c%d.workers", plrno, i);
 
     secfile_insert_bool(file, pcity->production.is_unit, 
-                      "player%d.c%d.production.is_unit", plrno, i);
+                      "player%d.c%d.is_building_unit", plrno, i);
     if (pcity->production.is_unit) {
       struct unit_type *punittype = get_unit_type(pcity->production.value);
       secfile_insert_int(file, old_unit_type_id(punittype),
-                        "player%d.c%d.production.value", plrno, i);
+                        "player%d.c%d.currently_building", plrno, i);
       secfile_insert_str(file, unit_name_orig(punittype),
-                         "player%d.c%d.production.value_name", plrno, i);
+                         "player%d.c%d.currently_building_name", plrno, i);
     } else {
       secfile_insert_int(file, old_impr_type_id(pcity->production.value),
-                         "player%d.c%d.production.value", plrno, i);
+                         "player%d.c%d.currently_building", plrno, i);
       secfile_insert_str(file, get_improvement_name_orig(
                                    pcity->production.value),
-                         "player%d.c%d.production.value_name", plrno, i);
+                         "player%d.c%d.currently_building_name", plrno, i);
     }
 
     /* 1.14 servers depend on improvement order in ruleset. Here we

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13564) broken savegames from city_production struct, Jason Short <=