Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] (PR#14436) use nodup for rulesets
Home

[Freeciv-Dev] (PR#14436) use nodup for rulesets

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#14436) use nodup for rulesets
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 23 Oct 2005 11:36:49 -0700
Reply-to: bugs@xxxxxxxxxxx

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

This patch prevents duplicate entries in rulesets.

The patches are for the development version and 2.0.  There is a genuine 
bug in the 2.0 civ1 ruleset; I'm not sure if my fix is correct.

-jason

Index: server/ruleset.c
===================================================================
--- server/ruleset.c    (revision 11175)
+++ server/ruleset.c    (working copy)
@@ -163,7 +163,7 @@
 
   sz_strlcpy(sfilename, dfilename);
 
-  if (!section_file_load(file,sfilename)) {
+  if (!section_file_load_nodup(file, sfilename)) {
     freelog(LOG_FATAL,
            /* TRANS: message for an obscure ruleset error. */
            _("Could not load ruleset file \"%s\"."), sfilename);
Index: data/civ2/terrain.ruleset
===================================================================
--- data/civ2/terrain.ruleset   (revision 11175)
+++ data/civ2/terrain.ruleset   (working copy)
@@ -425,7 +425,6 @@
 cooler_wetter_result = "Desert"
 cooler_drier_result  = "Tundra"
 flags                = "CanHaveRiver"
-flags                = "CanHaveRiver"
 property_tropical    = 50
 property_foliage     = 50
 property_wet         = 50
Index: data/nation/phoenician.ruleset
===================================================================
--- data/nation/phoenician.ruleset      (revision 11175)
+++ data/nation/phoenician.ruleset      (working copy)
@@ -24,7 +24,6 @@
 expand=2
 civilized=2
 advisors=100,100,100,100,100,100,100
-init_techs=""
 
 init_government="Despotism"
 init_units=""
Index: server/ruleset.c
===================================================================
--- server/ruleset.c    (revision 11169)
+++ server/ruleset.c    (working copy)
@@ -156,7 +156,7 @@
 
   sz_strlcpy(sfilename, dfilename);
 
-  if (!section_file_load(file,sfilename)) {
+  if (!section_file_load_nodup(file, sfilename)) {
     freelog(LOG_FATAL,
            /* TRANS: message for an obscure ruleset error. */
            _("Could not load ruleset file \"%s\"."), sfilename);
Index: data/nation/phoenician.ruleset
===================================================================
--- data/nation/phoenician.ruleset      (revision 11169)
+++ data/nation/phoenician.ruleset      (working copy)
@@ -17,7 +17,6 @@
 expand=2
 civilized=2
 advisors=100,100,100,100,100,100,100
-init_techs=""
 
 tech_goals = "Alphabet", "Trade", "Seafaring", "Navigation"
 
Index: data/civ1/buildings.ruleset
===================================================================
--- data/civ1/buildings.ruleset (revision 11169)
+++ data/civ1/buildings.ruleset (working copy)
@@ -1260,11 +1260,8 @@
     { "name", "range", "value", "req_type", "req"
       "Science_Bonus", "Player", 50, "Building", "Library"
       "Science_Bonus", "Player", 50, "Building", "University"
+      "Science_Bonus", "City", 100
     }
-effect         =
-    { "type", "range", "amount"
-       "Science_Bonus", "City", 100
-    }
 sound          = "w_isaac_newtons_college"
 sound_alt      = "w_generic"
 ; /* xgettext:no-c-format */
Index: data/civ2/terrain.ruleset
===================================================================
--- data/civ2/terrain.ruleset   (revision 11169)
+++ data/civ2/terrain.ruleset   (working copy)
@@ -419,7 +419,6 @@
 cooler_wetter_result = "Desert"
 cooler_drier_result  = "Tundra"
 flags                = "CanHaveRiver"
-flags                = "CanHaveRiver"
 helptext            = _("\
 Jungles are densely overgrown, making agriculture somewhat\
  problematic.\

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#14436) use nodup for rulesets, Jason Short <=