]> granicus.if.org Git - nethack/commitdiff
compatibility checks fix for TIMED_DELAY
authornethack.rankin <nethack.rankin>
Thu, 15 Aug 2002 02:48:34 +0000 (02:48 +0000)
committernethack.rankin <nethack.rankin>
Thu, 15 Aug 2002 02:48:34 +0000 (02:48 +0000)
     makedefs has been listing TIMED_DELAY as one of the options which
affects save file contents even though that hasn't been the case for
a long time.  Unfortunately, simply fixing that by itself would break
save file compatibility for anyone who has been building with it set.
This workaround prevents the fix from doing that.  And now folks can
rebuild after toggling TIMED_DELAY without unnecessarily invalidating
save and bones files.

doc/fixes34.1
src/version.c
util/makedefs.c

index 8c8576903a96bf06476f95c56933bcdfe1522f2a..7fe5b8c274e1cd7062c09eb9a2df6338882fd7bb 100644 (file)
@@ -206,6 +206,7 @@ engulfing green slime as a purple worm was causing stoning not sliming
 zero entries in DUNGEON, MONSTERS, et al, of config file are now treated
        as preserving the default rather than being ignored
 enlightenment: don't misreport polymorphed lycanthrope as "in beast form"
+remove TIMED_DELAY from the features checked for version compatibility
 
 
 Platform- and/or Interface-Specific Fixes
index 02f577ec71b63c18768bca96e10d466801cb9cf9..669d22d9c90cbec2a8bd5b14fd88c3a7974368ac 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)version.c  3.4     1999/12/01      */
+/*     SCCS Id: @(#)version.c  3.4     2002/08/14      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -64,7 +64,13 @@ boolean complain;
            if (complain)
                pline("Version mismatch for file \"%s\".", filename);
            return FALSE;
-       } else if (version_data->feature_set != VERSION_FEATURES ||
+       } else if (
+#ifndef IGNORED_FEATURES
+                  version_data->feature_set != VERSION_FEATURES ||
+#else
+                  (version_data->feature_set & ~IGNORED_FEATURES) !=
+                         (VERSION_FEATURES & ~IGNORED_FEATURES) ||
+#endif
                   version_data->entity_count != VERSION_SANITY1 ||
                   version_data->struct_sizes != VERSION_SANITY2) {
            if (complain)
index 46c21c2f8b0bd9e2853673a0f683b6d8bdd23a44..0c27da698b0a5ada130eb3d4c32d6669c724c01e 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)makedefs.c 3.4     2002/03/03      */
+/*     SCCS Id: @(#)makedefs.c 3.4     2002/08/14      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* Copyright (c) M. Stephenson, 1990, 1991.                      */
 /* Copyright (c) Dean Luick, 1990.                               */
@@ -406,6 +406,18 @@ do_rumors()
        return;
 }
 
+/*
+ * 3.4.1: way back in 3.2.1 `flags.nap' became unconditional but
+ * TIMED_DELAY was erroneously left in VERSION_FEATURES and has
+ * been there up through 3.4.0.  Simply removing it now would
+ * break save file compatibility with 3.4.0 files, so we will
+ * explicitly mask it out during version checks.
+ * This should go away in the next version update.
+ */
+#define IGNORED_FEATURES       ( 0L \
+                               | (1L << 23)    /* TIMED_DELAY */ \
+                               )
+
 static void
 make_version()
 {
@@ -465,9 +477,6 @@ make_version()
 #endif
 #ifdef SCORE_ON_BOTL
                        | (1L << 21)
-#endif
-#ifdef TIMED_DELAY
-                       | (1L << 23)
 #endif
                /* data format [COMPRESS excluded] (27..31) */
 #ifdef ZEROCOMP
@@ -569,6 +578,10 @@ do_date()
                version.incarnation, ul_sfx);
        Fprintf(ofp,"#define VERSION_FEATURES 0x%08lx%s\n",
                version.feature_set, ul_sfx);
+#ifdef IGNORED_FEATURES
+       Fprintf(ofp,"#define IGNORED_FEATURES 0x%08lx%s\n",
+               (unsigned long) IGNORED_FEATURES, ul_sfx);
+#endif
        Fprintf(ofp,"#define VERSION_SANITY1 0x%08lx%s\n",
                version.entity_count, ul_sfx);
        Fprintf(ofp,"#define VERSION_SANITY2 0x%08lx%s\n",