Author: cazfi
Date: Tue Dec 30 05:25:24 2014
New Revision: 27447

URL: http://svn.gna.org/viewcvs/freeciv?rev=27447&view=rev
Log:
Fixed loading game.ruleset that has no "settings" section (i.e., made it 
optional)

See bug #23110

Modified:
    trunk/server/settings.c

Modified: trunk/server/settings.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/settings.c?rev=27447&r1=27446&r2=27447&view=diff
==============================================================================
--- trunk/server/settings.c     (original)
+++ trunk/server/settings.c     Tue Dec 30 05:25:24 2014
@@ -3513,16 +3513,15 @@
     /* no settings in ruleset file */
     log_verbose("no [%s] section for game settings in %s", section,
                 secfile_name(file));
-    return FALSE;
-  }
-
-  for (j = 0; (name = secfile_lookup_str_default(file, NULL, "%s.set%d.name",
-                                                 section, j)); j++) {
-    char path[256];
-    fc_snprintf(path, sizeof(path), "%s.set%d", section, j);
-
-    if (!setting_ruleset_one(file, name, path)) {
-      log_error("unknown setting in '%s': %s", secfile_name(file), name);
+  } else {
+    for (j = 0; (name = secfile_lookup_str_default(file, NULL, "%s.set%d.name",
+                                                   section, j)); j++) {
+      char path[256];
+      fc_snprintf(path, sizeof(path), "%s.set%d", section, j);
+
+      if (!setting_ruleset_one(file, name, path)) {
+        log_error("unknown setting in '%s': %s", secfile_name(file), name);
+      }
     }
   }
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to