Author: sveinung
Date: Wed May 11 11:12:58 2016
New Revision: 32663

URL: http://svn.gna.org/viewcvs/freeciv?rev=32663&view=rev
Log:
Stop pre upgrade retired Base flags complaints.

Don't complain about retired base flags before a 2.6 ruleset have had the
chance to be upgraded.

Reported by Marko Lindqvist <cazfi>

See bug #24630

Modified:
    trunk/server/rssanity.c
    trunk/server/rssanity.h
    trunk/server/ruleset.c
    trunk/tools/ruledit/tab_misc.cpp

Modified: trunk/server/rssanity.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/rssanity.c?rev=32663&r1=32662&r2=32663&view=diff
==============================================================================
--- trunk/server/rssanity.c     (original)
+++ trunk/server/rssanity.c     Wed May 11 11:12:58 2016
@@ -540,7 +540,7 @@
 
   Returns TRUE iff everything ok.
 **************************************************************************/
-bool sanity_check_ruleset_data(void)
+bool sanity_check_ruleset_data(bool ignore_retired)
 {
   int num_utypes;
   int i;
@@ -855,6 +855,11 @@
   extra_type_by_cause_iterate(EC_BASE, pextra) {
     int bfi;
     struct base_type *pbase = extra_base_get(pextra);
+
+    if (ignore_retired) {
+      /* Base flags haven't been updated yet. */
+      break;
+    }
 
     for (bfi = 0; bfi < BF_COUNT; bfi++) {
       if (!base_flag_is_retired(bfi)) {

Modified: trunk/server/rssanity.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/rssanity.h?rev=32663&r1=32662&r2=32663&view=diff
==============================================================================
--- trunk/server/rssanity.h     (original)
+++ trunk/server/rssanity.h     Wed May 11 11:12:58 2016
@@ -19,7 +19,7 @@
 
 bool autoadjust_ruleset_data(void);
 bool autolock_settings(void);
-bool sanity_check_ruleset_data(void);
+bool sanity_check_ruleset_data(bool ignore_retired);
 
 #ifdef __cplusplus
 }

Modified: trunk/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/ruleset.c?rev=32663&r1=32662&r2=32663&view=diff
==============================================================================
--- trunk/server/ruleset.c      (original)
+++ trunk/server/ruleset.c      Wed May 11 11:12:58 2016
@@ -7665,7 +7665,7 @@
     road_integrators_cache_init();
 
     ok = autoadjust_ruleset_data()
-      && sanity_check_ruleset_data();
+      && sanity_check_ruleset_data(compat_info.compat_mode);
   }
 
   if (ok) {

Modified: trunk/tools/ruledit/tab_misc.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/ruledit/tab_misc.cpp?rev=32663&r1=32662&r2=32663&view=diff
==============================================================================
--- trunk/tools/ruledit/tab_misc.cpp    (original)
+++ trunk/tools/ruledit/tab_misc.cpp    Wed May 11 11:12:58 2016
@@ -200,7 +200,7 @@
   strncpy(game.control.version, version->text().toUtf8().data(),
           sizeof(game.control.version));
 
-  if (!autoadjust_ruleset_data() || !sanity_check_ruleset_data()) {
+  if (!autoadjust_ruleset_data() || !sanity_check_ruleset_data(false)) {
     QMessageBox *box = new QMessageBox();
 
     box->setText("Current data fails sanity checks. Save anyway?");


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

Reply via email to