Author: cazfi
Date: Thu Jul  7 22:14:48 2016
New Revision: 33198

URL: http://svn.gna.org/viewcvs/freeciv?rev=33198&view=rev
Log:
Fixed loading of ruleset when a nation has no init_units defined.

Reported by Sveinung Kvilhaugsvik <sveinung>

See bug #24766

Modified:
    trunk/server/ruleset.c

Modified: trunk/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/ruleset.c?rev=33198&r1=33197&r2=33198&view=diff
==============================================================================
--- trunk/server/ruleset.c      (original)
+++ trunk/server/ruleset.c      Thu Jul  7 22:14:48 2016
@@ -549,8 +549,8 @@
 
 /**************************************************************************
  Lookup a string prefix.entry in the file and return the corresponding
- improvement pointer.  If (!required), return B_NEVER for match "None" or
- can't match.  If (required), die when can't match.
+ improvement pointer. Return B_NEVER for match "None" or
+ can't match.
  If description is not NULL, it is used in the warning message
  instead of prefix (eg pass unit->name instead of prefix="units2.u27")
 **************************************************************************/
@@ -603,9 +603,11 @@
   }
   slist = secfile_lookup_str_vec(file, &nval, "%s.%s", prefix, entry);
   if (nval == 0) {
-    ruleset_error(LOG_ERROR, "\"%s\": missing string vector %s.%s",
-                  filename, prefix, entry);
-    return FALSE;
+    /* 'No vector' is considered same as empty vector */
+    if (slist != NULL) {
+      free(slist);
+    }
+    return TRUE;
   }
   if (nval > MAX_NUM_UNIT_LIST) {
     ruleset_error(LOG_ERROR,


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

Reply via email to