Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2005:
[Freeciv-Dev] (PR#13142) fix sciencebox/researchcost compatibility bugs
Home

[Freeciv-Dev] (PR#13142) fix sciencebox/researchcost compatibility bugs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13142) fix sciencebox/researchcost compatibility bugs
From: "Jason Dorje Short" <jdorje@xxxxxxxxx>
Date: Thu, 19 May 2005 09:12:41 -0700
Reply-to: bugs@xxxxxxxxxxx

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

This patch fixes two bugs with compatibility of researchcost/sciencebox
values.

1.  Current CVS games cannot be loaded in 2.0 because of a typo of
"game.researchcost.".

2.  2.0 games loaded in current CVS need to have the researchcost
multiplied by 5 (to make it a percentage).

-jason

Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.248
diff -u -r1.248 savegame.c
--- server/savegame.c   10 May 2005 17:27:09 -0000      1.248
+++ server/savegame.c   19 May 2005 16:11:18 -0000
@@ -3281,10 +3281,10 @@
     if (game.info.sciencebox == 0) {
       /* Researchcost was used for 2.0 and earlier servers. */
       game.info.sciencebox
-       = secfile_lookup_int_default(file, 0, "game.researchcost");
+       = 5 * secfile_lookup_int_default(file, 0, "game.researchcost");
       if (game.info.sciencebox == 0) {
        /* With even earlier servers (?) techlevel was used for this info. */
-       game.info.sciencebox = secfile_lookup_int(file, "game.techlevel");
+       game.info.sciencebox = 5 * secfile_lookup_int(file, "game.techlevel");
       }
     }
 
@@ -3864,7 +3864,7 @@
   secfile_insert_int(file, game.info.sciencebox, "game.box_science");
   {
     /* These values are for compatibility with 2.0 and previous servers. */
-    secfile_insert_int(file, game.info.sciencebox / 5, "game.researchcost.");
+    secfile_insert_int(file, game.info.sciencebox / 5, "game.researchcost");
   }
   secfile_insert_int(file, game.info.techpenalty, "game.techpenalty");
   secfile_insert_int(file, game.info.razechance, "game.razechance");

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13142) fix sciencebox/researchcost compatibility bugs, Jason Dorje Short <=