Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] (PR#14185) make nation parameters manditory
Home

[Freeciv-Dev] (PR#14185) make nation parameters manditory

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#14185) make nation parameters manditory
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 4 Oct 2005 10:17:01 -0700
Reply-to: bugs@xxxxxxxxxxx

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

This patch makes a few fields in the nation rulesets manditory: legend 
and city style.  Now no nation should be without them.  (I also added a 
stupid legend to the barbarian nation...which is currently unused but 
may be possible to be used in scenarios under mateusz 
playable-nation-scenario patch.)

-jason

Index: data/nation/barbarian.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/barbarian.ruleset,v
retrieving revision 1.12
diff -p -u -r1.12 barbarian.ruleset
--- data/nation/barbarian.ruleset       3 Sep 2005 00:58:08 -0000       1.12
+++ data/nation/barbarian.ruleset       4 Oct 2005 17:14:40 -0000
@@ -2,6 +2,8 @@
 
 name=_("Barbarian")
 plural=_("?plural:Barbarians")
+legend=_("Since the dawn of civilization, barbarians have been a threat to\
+cultured peoples everywhere.")
 leader="Genseric", "Alaric", "Theodoric", "Stilicho", "Attila", "Boadicea"
 leader_sex="Male", "Male", "Male", "Male", "Male", "Female"
 flag="barbarian"
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.286
diff -p -u -r1.286 ruleset.c
--- server/ruleset.c    3 Oct 2005 02:50:47 -0000       1.286
+++ server/ruleset.c    4 Oct 2005 17:14:41 -0000
@@ -2053,7 +2053,7 @@ static void load_ruleset_nations(struct 
     struct nation_group* group;
     name = secfile_lookup_str(file, "%s.name", groups[i]);
     group = add_new_nation_group(name);
-    group->match = secfile_lookup_int_default(file, 0, "%s.match", groups[i]);
+    group->match = secfile_lookup_int(file, "%s.match", groups[i]);
   }
   free(groups);
 
@@ -2178,7 +2178,7 @@ static void load_ruleset_nations(struct 
     /* City styles */
 
     sz_strlcpy(temp_name,
-              secfile_lookup_str_default(file, "-", "%s.city_style", sec[i]));
+              secfile_lookup_str(file, "%s.city_style", sec[i]));
     pl->city_style = get_style_by_name(temp_name);
     if (pl->city_style == -1) {
       freelog(LOG_NORMAL,
@@ -2246,8 +2246,7 @@ static void load_ruleset_nations(struct 
 
     pl->city_names = load_city_name_list(file, sec[i], ".cities");
 
-    pl->legend =
-       mystrdup(secfile_lookup_str_default(file, "", "%s.legend", sec[i]));
+    pl->legend = mystrdup(secfile_lookup_str(file, "%s.legend", sec[i]));
     if (check_strlen(pl->legend, MAX_LEN_MSG, "Legend '%s' is too long")) {
       pl->legend[MAX_LEN_MSG - 1] = '\0';
     }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#14185) make nation parameters manditory, Jason Short <=