Author: sveinung
Date: Mon Jun 20 02:38:08 2016
New Revision: 32923

Auto adjust the result of ruleset compatibility.

The ruleset compatibility post processing may have given the ruleset a need
for ruleset sanity auto adjustment. Rerun the auto adjustment after the
compatibility post processing.

At the moment ruleset compatibility post processing only happens in programs
that end up saving the ruleset. The result of the compatibility post
processing will therefore be auto adjusted before use. But loading and
resaving without any changes shouldn't give a different result.

See patch #7274


Modified: trunk/server/rscompat.c
--- trunk/server/rscompat.c     (original)
+++ trunk/server/rscompat.c     Mon Jun 20 02:38:08 2016
@@ -33,6 +33,7 @@
 #include "unittype.h"
 /* server */
+#include "rssanity.h"
 #include "ruleset.h"
 #include "rscompat.h"
@@ -868,6 +869,14 @@
   /* Upgrade existing effects. */
   iterate_effect_cache(effect_list_compat_cb, info);
+  /* The ruleset may need adjustments it didn't need before compatibility
+   * post processing.
+   *
+   * If this isn't done a user of ruleset compatibility that ends up using
+   * the rules risks bad rules. A user that saves the ruleset rather than
+   * using it risks an unexpected change on the next load and save. */
+  autoadjust_ruleset_data();

Freeciv-commits mailing list

Reply via email to